I am getting totally frustrated now...
Trying to use an edit method within a controller. All the other controllers work fine, but here I might have missed something and could not find.
Error:
Missing required parameters for [Route: blocked.edit] [URI:
remittance/blocked/{blocked}/edit]. (View:
/var/www/xxxxxxxx/resources/views/layouts/app.blade.php) (View:
/var/www/xxxxxxxx/resources/views/layouts/app.blade.php)
Here is my controller method:
public function edit($id)
{
$blocked = $this->model->find($id);
return view('remittance::edit', compact('blocked'));
}
Route to this method:
remittance/blocked/{blocked}/edit | blocked.edit | Modules\Remittance\Http\Controllers\RemittanceController@edit
Route:
Route::resource('remittance/blocked', 'RemittanceController', [
'except' => ['show']
]);
I am calling this method from DataTables, whenever I click edit I am directed to url:
http://localhost/remittance/blocked/xxxx/edit
Snippet from DataTables class where it is rendered:
addColumn('action', function ($query) {
return view('partials.actions.delete', [
'actions' => ['edit'],
'route' => $this->model,
'object' => $query
]);
})
Which is correct for the routes. I checked other similar topics to this one, but all of them were caused because of missing {parameter}.