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.8] Add 'index' => 'viewAny' to resourceAbilityMap #28820

merged 1 commit into from Jun 12, 2019


None yet
4 participants
Copy link

commented Jun 12, 2019

Automatically bind the viewAny method to the index controller action

@GrahamCampbell GrahamCampbell changed the title add 'index' => 'viewAny' to resourceAbilityMap [5.8] Add 'index' => 'viewAny' to resourceAbilityMap Jun 12, 2019

@taylorotwell taylorotwell merged commit 21da43f into laravel:5.8 Jun 12, 2019

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
continuous-integration/styleci/pr The analysis has passed

This comment has been minimized.

Copy link

commented Jun 13, 2019

First of all I think this is a nice addition.
But it breaks if you don't have a viewAny on your policy and use $this->authorizeResource(Model::class, 'model');
That result in that I'm not sure that this isn't a backward compatibility break.

Maybe it is an idea for the next time to add it more clear to the releasenotes.

@clement-jacquet clement-jacquet deleted the clement-jacquet:abilityMap branch Jun 13, 2019


This comment has been minimized.

Copy link

commented Jun 14, 2019

FYI it is a breaking change. We tried to add it last year but got rejected #26078 but glad it got through this time...

Time to update all our controller and policies :)


This comment has been minimized.

Copy link
Contributor Author

commented Jun 15, 2019

What if we check if the gate exists before actually adding it as a middleware ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.