Spark 7.0 error with Route Model Binding

Posted 10 months ago by mariohbrino

I have one issue with Laravel Spark 7.0, the route model binding doesn't abort when it passes a string. It works fine at Laravel 5.7, only in Spark it happens.

Any one can help me with this? Thanks.

Route

Route::get('api/users/{user}', function (App\User $user) {
    return $user->email;
});

Example: app.local/api/user/test

Result

SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "test" (SQL: select * from "users" where "id" = test limit 1)

Please sign in or create an account to participate in this conversation.