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

Subdomain Routing does not resolve an implicit binding with a custom key #33226

Closed
felixdorn opened this issue Jun 15, 2020 · 1 comment · Fixed by #33231
Closed

Subdomain Routing does not resolve an implicit binding with a custom key #33226

felixdorn opened this issue Jun 15, 2020 · 1 comment · Fixed by #33231
Assignees
Labels

Comments

@felixdorn
Copy link
Contributor

  • Laravel Version: 7.15.0
  • PHP Version: 7.4.6

Description:

It looks like we can't implicitly bind something with a custom key in a Route::domain and equivalent.

Steps To Reproduce:

  • Create a model, Project, with a property, domain in my case.
Route::domain('{project:domain}.app.wip')->group(function () {
    Route::get('/', function (Project $project) {
        dd($project);
    });
});

It works using only {project} but it uses the id, logic.
It works using a custom binding :

Route::bind('projectDomain', function ($domain) {
    // return the project based on the domain
});

I don't know if I missed something, or it's a bug, the documentation does not talk about this specific case (I didn't found relevant tests for this) but I might be blind.

@felixdorn felixdorn changed the title Subdomain Routing does not resolve an implicit ninding with a custom key Subdomain Routing does not resolve an implicit binding with a custom key Jun 15, 2020
@driesvints
Copy link
Member

I went deep into the rabbit hole on this one but couldn't figure it out. It indeed doesn't works and I'd also expect it to should work. I can't pinpoint where the matching with the dynamic subdomain route is taking place. Gonna ping @taylorotwell to see if he knows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants