Display array in laravel blade code example

Example 1: how to print array in laravel blade

@php
            var_dump($arr);
        @endphp

Example 2: how to print array in laravel blade

<?php dd($array); ?>

Example 3: how to print array in laravel blade

@foreach ($watchFolder as $w)
    {{ $w->name }}    
@endforeach

Example 4: how to print array in laravel blade

class WatchController extends Controller
{
    public function index(\Illuminate\Filesystem\Filesystem $filesystem)
    {
        $files = $filesystem->allFiles($watchFolderPath);

        // Your code.

        return view('name', ['files' => $files]);
    }
}

Tags:

Php Example