Closed Fanamurov closed 8 years ago
If i understand correctly you're trying to rename the public
directory to public_html
right?
The cleanest way of doing this is probably by making sure public_path()
returns "public_html". You can learn how do that on this thread on the Laracasts forum
I just like to Laracasts, everything is working correctly, except MediaLibrary
Please check the path to the root of your disk in config/filesystems.php
. That should be a directory inside the directory returned by public_path
.
I place this code in main front controller:
$diskRootPath = config('filesystems.disks.media.root');
dd(realpath($diskRootPath));
return "/Applications/MAMP_SITES/laravel.local/larrock/public_html/media" (work good)
start phpunit:
return FALSE $diskRootPath = "/Applications/MAMP_SITES/laravel.local/larrock/public/media"
what is the content of config/filesystems.php
and does public_path
return the right path when running unit tests?
Sorry, here is the solution to the problem of tests
in config/filesystems.php
'media' => [
'driver' => 'local',
'root' => public_path().'/media',
],
change to
'media' => [
'driver' => 'local',
'root' => base_path() .'/public_html/media',
],
Thank you
I change public directory, site work.
I create test:
Run:
class LocalUrlGenerator:
realpath return FALSE, because $this->config->get('filesystems.disks.'.$this->media->disk.'.root') return '/Applications/MAMP_SITES/larrock.local/public/media'
but work is: /Applications/MAMP_SITES/larrock.local/public_html/media
in config/filesystems.php
in public_html/index.php
How fix this for phpunit and changed public_path()?