Level 75
Use move
$file->move($destinationPath, $fileName);
$destinationPath is a variable you create to the path you want.
Change to your variable names as needed.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
After I deployed my laravel project to a shared hosting from bluehost, as this tutorial https://dev.to/asapabedi/deploying-laravel-5-applications-on-shared-hosting-without-the-use-of-ssh--16a6 now I can not upload files to public_html it upload them to public directory which outside public_html
Go Config/filesystem.php
and modify
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
to be like
'public' => [
'driver' => 'local',
'root' => public_path('/../../public_html'),
'url' => env('APP_URL').'/public',
'visibility' => 'public',
],
Please or to participate in this conversation.