Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

laracoft's avatar
Level 27

Check if model has policy

Is there a programmatic way to check if a model has a policy?

0 likes
1 reply
tykus's avatar
tykus
Best Answer
Level 104

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.