So, I am working on an admin interface. I have a route configured like this:
Route::controllers([
'admin' => 'AdminController',
]);
Then I have a controller with some methods:
public function getEditUser($user_id = null)
{
}
public function postEditUser($user_id = 0, EditUserRequest $request)
{
}
As you can see, I am using the injection method to validate user input, so the URL will look like this:
http://example.com/admin/edit-user/8697
The GET request will be passed to the GET method and the POST request to the POST method. The problem is that if I create a new user, the identifier will not be:
http://examplecom/admin/edit-user/
Then I get the error message (rephrased):
Argument 2 passed to the controller must be an instance of EditUserRequest not specified
, 0, , , ? , , ? .