DEV Community 👩‍💻👨‍💻

Mahedi Hasan
Mahedi Hasan

Posted on

Laravel 6 Gate and Policy Example from Scratch

In this tutorial we are going to see how we can protect user access from specific route using laravel gate and policy. it is pretty simple.

Think of gates and policies like routes and controllers. Gates provide a simple, Closure based approach to authorization while policies, like controllers, group their logic around a particular model or resource. We'll explore gates first and then examine policies.

Today, we're going to discuss the authorization system of the Laravel web framework. The Laravel framework implements authorization in the form of gates and policies. After an introduction to gates and policies, I'll demonstrate the concepts by implementing a custom example.

https://www.codechief.org/article/laravel-gate-and-policy-example-from-scratch

Top comments (1)

Collapse
 
victorlimeira profile image
Mannuel Victor Limeira

Link returns 404. :'(

Let's team up together 🤝

We're Hiring

We're hiring for a Senior Full Stack Engineer to join the DEV team. Want the deets? Head here to learn more about who we're looking for.