'how to display array data in row view in laravel

array data enter image description here

my code in index.blade.php

 <tr>
    @php
        $filter_date = \Carbon\Carbon::parse(request()->query('filter_date'))->format('Y-m-d');
        $end_date = \Carbon\Carbon::parse(request()->query('end_date'))->format('Y-m-d');

     $dateRangePeriod = \Carbon\CarbonPeriod::create($filter_date, $end_date);
     $dateRange = [];
     
     foreach ($dateRangePeriod as $key => $date) {
           $dateRange[] = $date->format('d  F');
     }

    //return array :
    //dd($dateRange);

  @endphp
      
   <th colspan="4" class="text-center"> {{ $dateRange}}</th>

</tr>

i want to display array of data from date and to date in laravel view line. when i call data {{ $dateRange}} i get error: TypeError:htmlspecialchars(): Argument #1 ($string) must be of type string, array given. how to solve my problem, help me, thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source