[Vuejs]-PHP upload file with api

0👍

I believe your problem lies here:

$image = $request->get('avatar');
$path = Storage::putFile('avatars', base64_decode($image));

Per the docs, you’re going to want to use $request->file('avatar') to access the file.

Then, you can do store('avatars') to store it in your default storage location.

In short:

$path = $request->file('avatar')->store('avatars');

Leave a comment