Laravel Community Tools by Tighten

Rick Mann

Joined: 10 years ago
Total tricks: 2
Last trick: 9 years ago

Submitted tricks

The Authorization feature that was introduced in 5.1.11 is designed around the idea of associating models with policies, but sometimes you want to be able to define an encompassing policy to check for capabilities at a higher level, in which case checking against models might not make sense. This trick allows defining abilities in the gate based on the methods defined in a policy class.
Riari 10 years ago 14540
5.0
This employs Eloquent's polymorphic relationships (https://laravel.com/docs/5.1/eloquent-relationships#polymorphic-relations) to provide a simple flat comment thread system.
Riari 9 years ago 12549