check your form you might me be missing ``` enctype="multipart/form-data"
<form action="" enctype="multipart/form-data" method="post">
@csrf
..
</form>
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
trying to upload avatar for user getting thisError Call to a member function storeAs() on null
use WithFileUploads;
protected $rules = [
'user.avatar' => 'image|max:1032',
// must add addition fields here
];
public function save()
{
// dd($this->user);
$this->validate();
$this->avatar->storeAs('avatar', 'public');
$this->user->save();
$this->updateMode = false;
session()->flash('message', 'Users Updated Successfully.'); // this works?
$this->reset();
}
Please or to participate in this conversation.