Level 102
What error are you getting?
I set this up as follows.
It works perfectly fine on a localhost setup, but doing it through Client Server, it fails to upload the image or logo.
What am I missing here?
UploadFileController.php
public function uploadLogo(Request $request) {
$user = Auth::user();
if ($user) {
$file = $request->file;
$publicPath = public_path();
$path = $publicPath.'\img\logo.png';
if (File::exists($path)) {
File::delete($path);
}
$path = $request->file->storeAs('img', 'logo.png', 'logo');
return 'saved';
}
}
filesystems.php
'logo' => [
'driver' => 'local',
'root' => public_path(),
'url' => env('APP_URL').'/public',
'visibility' => 'public',
],
in laravel you have to create link to your storage folder in public folder using command , then you can see images,
php artisan storage:link
Please or to participate in this conversation.