Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ondimu's avatar

Getting error of 404 on livewire mount Model $model

On run of the mount function passed with Model $model, i get a return error of 404

This one throws a 404

routes/web.php

   Route::get('route/{model}', ApplicationView::class);

livewire/component.php

    public function mount(Model $model)
   {
        ...
   }

This works

routes/web.php

   Route::get('route/{id}', ApplicationView::class);

livewire/component.php

public function mount($id)
   {
        $model = Model::find($id);
   }

Note: I am using the same id and the record exists in the db

Also, this is specific to this model, all my other models work just fine with the first implementation.

0 likes
2 replies
tangtang's avatar

@ondimu

usually it's happen because this mount function can't find the Model.php file,

but can you give more detail information with this error ? like the code or route ?

Ondimu's avatar

@tangtang I updated my question. Sorry for that vague description at first.

Please or to participate in this conversation.