Missing Required Parameters for Route in Laravel error

Tags: , ,



I am working with Laravel in this route :

Route::get('turnIn/{turnin}',"TurninController@index")->name('turnin.index');

and when calling the route :

{{ route('turnin.index', [$turnin])}}

Shows an error Missing required parameters for [Route: turnin.index] [URI: turnIn/{turnin}].

Answer

I figured it out, I was passing an array of objects instead of a single one “Turnin” this is why the route wasn’t accepting the parameters



Source: stackoverflow