My structure is like this:
/laravelfiles
/public_html
--/demo
----/index.php (and other files inside public folder)
I have changed the index.php to access /laravelfiles, everything works fine.
My config filesystem:
'local' => [
'driver' => 'local',
'root' => public_path(),
],
'public' => [
'driver' => 'local',
'root' => public_path(),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
When I try to store a file:
Storage::disk('public')->put($folder.'/'.$file_name, $file_data);
It stores inside laravelfiles/public folder. Because it is separated the file is inaccessible.
What I want is to store the file inside the /public_html/demo folder (the same folder where index.php is).
How do I do that?
3
Answers
You must bind and change the public path in application to public_html by adding this line of code in AppServiceProvider.php
Try to use a third party storage, like Amazon S3 or Ms Azure. They have basic/free plans too.
Try add in your config/filesystems.php
and then