Good afternoon guys, I'm having an issue I don't know if you have the same trouble, I upgrade my Laravel project and now all routes like this
Route::get('detail/client/{client}', "controller@method")
are breaking everything because the object instanced in the controller comes empty...
public function detail(FileRequest $request, Client $client){
dd($client) // empty object
}
If someone can help me with this please. If I remove the Client model and make the dd
then return the ID of the object i.e "594"
You haven't written base Laravel version you are upgrading from, but I think it might have something in common with
\Illuminate\Routing\Middleware\SubstituteBindings::class
middleware.Make sure you have it in middlwareGroups like this:
in app/Http/Kernel.php file
and also make sure the routes you have problem are in
web
middleware group.