Level 67
Do you happen to have a getRouteKeyName() method in the LineItem model that is returning something other than id?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
It's returning a model but not being populated.
web.php
Route::resource('lineitems', 'LineItemController');
My post (DELETE) is:
/lineitems/43
My function is:
public function destroy(LineItem $lineItem) { dd($lineItem); }
ID 43 does exists The dd returns a model but not data in the model; meaning id 43 is not populate in the model.
Does you route wildcard match the param exactly?
Route::delete(‘line items/{lineItem}’, //...
Please or to participate in this conversation.