Hi
I am just trying to upload a file and save it off, however for some reason it is being saved in a directory with the same name as the file.
My code is :
$file = $request->photo;
$path = $file->hashName('styles');
$disk = Storage::disk('public');
$disk->put($path, $file);
return $disk->url($path);
My filesystems file under config is as follows
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage/',
'visibility' => 'public',
'storage' => '/storage/',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
],
],
so the file will be stored in directory structure like this
QgXDVY6vXR5Ao3xPbBihs5NXIKZFg8uvmUJfrCfx.png
QgXDVY6vXR5Ao3xPbBihs5NXIKZFg8uvmUJfrCfx.png
But when i do the call to ->url the result will be like this
http://localhost/storage/styles/QgXDVY6vXR5Ao3xPbBihs5NXIKZFg8uvmUJfrCfx.png
As you can see I can never find the file with the path returned and saved off.In addition to this echoing out the paths etc all gives the result without the additional directory
I have tried to work out what it is but at the moment hitting a brick wall
Thanks