Open Sheco opened 4 years ago
I think this simply isn't supported atm. The example in the docs also highlights that you should pass an instance rather than a class name.
I've moved this issue to the ideas repo instead. Feel free to send in a PR to support this 👍
I have this use case as well, and would love to see this added
This would be nice to have
:+1: for this idea. It could be proved very useful in cases of multi-tenancy
Description:
According to the docs on https://laravel.com/docs/6.x/authorization#supplying-additional-context
A policy can receive additional parameters like this:
This doesn't work correctly with methods without models when specifying the class name as a string (as suggested in other sections called "Actions That Don't Require Models"), but it does work when passing a new empty instance of this same class.
Steps To Reproduce: