I have just updated my Laravel to 5.8 and can't make my Policies auto-discovery work.
I think it's because all my models are in app/Models. The documentation says that I can change the default behavior using this gate.
Gate::guessPolicyNamesUsing(function ($modelClass) {
// return policy class name...
});
But I can't make it work. The check function '''$user->can()''' always return false for all my Policies and models. Is it really the problem? The models folder, or I'm missing somenting?
By the way, everything works great if I map it manually in the $policies array at AuthServiceProvider.php
Thank you!