Skip to content

Conversation

@faisuc
Copy link

@faisuc faisuc commented Nov 15, 2025

Fixes #316

Route model binding wasn't working when you define routes in an Action's routes() method. So if you had:

public static function routes(Router $router): void
{
    $router->get('/users/{user}', static::class);
}

public function handle(User $user)
{
    // $user was just a string "1" instead of the actual User model
}

The $user parameter would come through as a string instead of the resolved model. Kind of annoying since it works fine when you define routes in routes/web.php.

@faisuc faisuc marked this pull request as draft November 15, 2025 19:41
@faisuc faisuc marked this pull request as ready for review November 15, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route model binding not resolved when uses action routes

1 participant