Search code examples
phplaravelpublic

Laravel : How to located public folder in Laravel?


So I'm using this to save my images in the file fylesystems.php and it works, but now I want to deploy my project and 'root' => 'public/uploads' doesn't work. I know I'm doing something wrong but I don't know what, help please.

'uploads' => [
            'driver' => 'local',
            'root' => 'C:/Users/User/Desktop/Project/www/mycms/public/uploads'
        ],

Solution

  • You need to use public_path,

    'root' => public_path('uploads/'),
    

    After change make sure to do clear the caches.

    php artisan config:cache