Level 104
Using the getPolicyFor method on the Gate facade
Gate::getPolicyFor(App\Models\YourModel::class);
It will return an Object or null
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Is there a programmatic way to check if a model has a policy?
Using the getPolicyFor method on the Gate facade
Gate::getPolicyFor(App\Models\YourModel::class);
It will return an Object or null
Please or to participate in this conversation.