I am developing an api endpoint to use with my laravel and vue app.
public function avatar(Request $request)
    {
        $user = User::find(Auth::id());
        $validator = Validator::make($request->all(), [
            'avatar' => 'required'
        ]);
        if ($validator->fails()) {
            return response()->json(['errors' => $validator->errors()]);
        } else {
            $image = $request->get('avatar');
            //base64_decode($file_data)
            $path = Storage::putFile('avatars', base64_decode($image));
            $user->avatar_url = $path;
            if ($user->save()) {
                //return redirect()->route('user_profile_settings');
            }
        }
    }
This is the code that I have I tried going off what I found online to accomplish file uploads with an api and using php, but I am getting this error "Call to a member function hashName() on string". The goal of this is to upload the file to a s3 bucket using the putFile method.
 
    