Level 1
dd($upload); returns:
UploadedFile {#30 ▼
-test: false
-originalName: "create_tables.sql"
-mimeType: "application/sql"
-size: 7676
-error: 0
}
I'm trying to upload a file to store via Laravel's storage Api. My code is as following:
public function postAvatar(Request $request)
{
$upload = $request->file('avatar');
$extension = $upload->getClientOriginalExtension();
Storage::disk('local')->put($upload->getFilename().'.'.$extension, $upload);
return redirect('/dashboard');
}
I tried uploading a something.sql file but the file turns into something like phpZMYfrZ.sql with a content of /tmp/phpZMYfrZ ... any idea as to what I'm doing wrong?
Please or to participate in this conversation.