/** * Display the specified resource. * * @param string $name * @return Response */ public function show($name) { $project = Project::where('name', $name)->get()->first(); $x = new Filesystem(); $filesDestination = File::allfiles($_SERVER['DOCUMENT_ROOT'] . '/uploads/' . $name); $files = array(); for ($c = 0; $c < count($filesDestination); $c++) { $files[$c] = File::name($filesDestination[$c]) . '.' . File::extension($filesDestination[$c]); } //dd($filenames); return view('project.show', compact('project', 'files')); }