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

[5.3] Change visibility of Illuminate\Routing\Route::getController() to public #15678

Merged
merged 1 commit into from
Oct 3, 2016

Conversation

shadoWalker89
Copy link
Contributor

@shadoWalker89 shadoWalker89 commented Sep 29, 2016

My use case is the following :

When Customizing The Resolution Logic of route model binding i can do something like this :

Route::bind('data_set', function ($value) {
    $route = Route::getCurrentRoute();

    // If the request is coming from an admin controller
    if( $route->getController() instanceof AdminBaseController )
    {
        return 'Custom logic for model binding resolution in the admin area of the website';
    }

    // If the request is coming from api controller
    if( $route->getController() instanceof ApiBaseController )
    {
        return 'Custom logic for model binding resolution in the api';
    }

    //For any other request find or fail
    return DataSet::findOrFail($value);
});

@shadoWalker89 shadoWalker89 changed the title Change visibility of Illuminate\Routing\Route::getController() to public [5.3] Change visibility of Illuminate\Routing\Route::getController() to public Sep 29, 2016
@taylorotwell taylorotwell merged commit 4510b9b into laravel:5.3 Oct 3, 2016
@shadoWalker89 shadoWalker89 deleted the 5.3 branch October 4, 2018 21:03
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.

2 participants