I wanna display all files of a directory in the laravel application here is the error occurs about Finder can anyone help me with this.
Class 'Illuminate\Support\Facades\Finder' not found
Code
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Resource;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Finder;
public function index()
{
$dir=base_path('resources/views/t/');
return view('/admin/fileshandel/index')->with('allfiles' ,
iterator_to_array(Finder::create()->files()->in($dir), false));
}
Finder
class. (Note: Check5.9
anddev
versions also) – Tim Lewis