mirror of
https://github.com/archtechx/laravel-tips.git
synced 2025-12-12 13:24:03 +00:00
13 lines
476 B
Markdown
13 lines
476 B
Markdown
---
|
|
title: 'Use the policy() helper to resolve a policy for a model'
|
|
tweet_id: '1494019545446567939'
|
|
thread_slug: weekly-thread-2022-06
|
|
author_username: asantibanez
|
|
images:
|
|
- 'https://pbs.twimg.com/media/FLNAs-bXIAExJxr.jpg'
|
|
created_at: 2022-02-16T18:43:11+00:00
|
|
slug: use-the-policy-helper-to-resolve-a-policy-for-a-model
|
|
---
|
|
TIL about @laravelphp policy() helper. Give it a model and it will resolve the policy for you.
|
|
|
|
Very useful when testing policies behavior. 💪
|