Route model binding does not work
Closed this issue · 2 comments
Dirk94 commented
First of all, love the package. Unfortunately, the route model binding does not seem to work.
Steps to reproduce.
The form request
class CreateResourceRequest extends FormRequest
{
public function authorize()
{
$user = $this->route("user");
var_dump($user);
die();
}
}
Create an explicit binding
Route::model('user', App\User::class);
Run the test
$user = $this->createUser(); // Create a random test user.
$this->formRequest(CreateResourceRequest::class, [], [
'method' => 'POST',
'route' => "/resources/{$user->id}/create"
]);
The output is the id of the user instead of the user model.
int 1
mohammedmanssour commented
Hi, sorry for the late response!
I'll be working to fix it as soon as possible
mohammedmanssour commented
fixed in #10