Reputation: 580
Problem is my Storage is not working. It's not uploading my file into destinationPath. When i dd my file path it not taking destination.
Controller@store
$destinationPath = config('app.filesDestinationPath').'/'.$bank.'/'.$username.'/'.$date.'/';
foreach ($files as $file) {
$filename = $file->getClientOriginalName();
Storage::put($destinationPath.$filename.'.'.$file->getClientOriginalExtension(),file_get_contents($file->getRealPath()));
}
Controller@show
$directory = config('app.filesDestinationPath').'/'.$bank->$bank.'/'.$bank->username.'/'.$bank->date.'/';
$files = Storage::files($directory);
dd($files);
return view('banks.show', ['bank'=>$bank])->with(array('files' => $files));
Config/app
'fileDestinationPath' => 'uploads',
'allowedFileTypes' => 'jpg,jpeg,bmp,png',
'maxFileSize' => 1000000*2,
Config/filesystems
public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
Upvotes: 1
Views: 114
Reputation: 642
App\Filesystems.php
'local' => [
'driver' => 'local',
'root' => resource_path('app');
],
Upvotes: 1