Skip to content

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

Merged
taylorotwell merged 1 commit into
laravel:5.3from
shadoWalker89:5.3
Oct 3, 2016
Merged

[5.3] Change visibility of Illuminate\Routing\Route::getController() to public#15678
taylorotwell merged 1 commit into
laravel:5.3from
shadoWalker89:5.3

Conversation

@shadoWalker89

@shadoWalker89 shadoWalker89 commented Sep 29, 2016

Copy link
Copy Markdown
Contributor

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