What does $request->image_path->store('images', 'public'); do?
request()->file seems to be null
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, i'm trying to update a image in my dashboard but when I submit the update form it always return with:
Call to a member function store() on null
I have dd and look in the request and it looks like i'm passing in a image. Any ideas how to fix that? This posed is relate to my other post: https://laracasts.com/discuss/channels/laravel/update-a-image-path
But here is my update method in the Controller:
public function update(Request $request, $id)
{
$data = $request->except('image_path');
$data['image_path'] = request()->file('image_path')->store('images', 'public');
$camping->update($data);
return redirect('/stjornbord/tjaldsvæði/breyta');
}
Do you have enctype="multipart/form-data" on your form element?
<form action="/your-url" method="post" enctype="multipart/form-data">
</form>
Please or to participate in this conversation.