1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 21:34:03 +00:00
laravel-tips/content/tips/you-can-chain-can-to-route-definitions-to-specify-policy-rules.md
2021-11-12 18:43:31 +01:00

14 lines
491 B
Markdown

---
title: 'You can chain ->can() to Route definitions to specify policy rules'
tweet_id: '1459206740340187141'
thread_slug: weekly-thread-2021-45
author_username: sky_0xs
images:
- 'https://pbs.twimg.com/media/FDx9zXTXIAkeX_-.jpg'
created_at: 2021-11-12T17:09:32+00:00
slug: you-can-chain-can-to-route-definitions-to-specify-policy-rules
---
#Laravel Tip:
If you are running Laravel `v8.70`, you can chain `can()` method directly instead of `middleware('can:..')`
Here is and example: