Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit route model binding broken in Broadcasting #36443

Closed
mikerockett opened this issue Mar 3, 2021 · 1 comment
Closed

Explicit route model binding broken in Broadcasting #36443

mikerockett opened this issue Mar 3, 2021 · 1 comment

Comments

@mikerockett
Copy link

mikerockett commented Mar 3, 2021

  • Laravel Version: 8.30
  • PHP Version: 7.4.15
  • Database Driver & Version: Not Relevant

Description:

After upgrading to Laravel 8.30 this morning, explicit route model binding is not working in Broadcasting.

Likely related to: 8c5292e / #36375

Reporting as a bug, as this appears to be a breaking change.

Steps To Reproduce:

// in a service provider
$router->model('someModel', SomeModel::class);

// in routes
Broadcast::channel('SomeModel.{someModel}', SomeModelPresenceChannel::class);

// in SomeModelPresenceChannel
public function join(User $user, SomeModel $someModel): array
{
    return $user->broadcastProfile();
}

Results in this being thrown:

[9:06:08 AM] - 1ExhRwpqR3TUtF43AAAA could not be authenticated to presence-SomeModel.65
{
    "message": "Too few arguments to function Illuminate\\Routing\\RouteBinding::Illuminate\\Routing\\{closure}(), 1 passed and exactly 3 expected",
    "exception": "ArgumentCountError",
    "file": "/path/to/vendor/laravel/framework/src/Illuminate/Routing/RouteBinding.php",
    "line": 60,
    …
}
@mikerockett
Copy link
Author

Just to confirm, downgrading to 8.29.0 without any other changes fixes the issue.

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

No branches or pull requests

2 participants