I'm trying to create folder in public/storage
but when i call Storage::makeDirectory("public/storage/newdirectory")
it creats folder in storage folder with subfolders public/storage/newdirectory
. when i try to change it to ../public/storage
then i get error message "Path is outside of the defined root"
. Any idea how can i change it?
From internet found somethin like this: public_path("/storage/newdirectory");
and it doesn't helped.
Do this:
File::makeDirectory(public_path('storage/newdirectory'));
By default laravel takes storage
directory as root directory.
Change the root directoy info in filesystems.php
'local' => [
'driver' => 'local',
'root' => '/path/to/your/directory',
],