~/talk

Close the Gate! Using Laravel's Authorization Layer

Talkat Laracon EU 2019 · 2019-08-28..08-30· [security, php]
slides:none on file

Describes how Laravel Gates and Policies actually get wired: defining abilities, policy methods, middleware and Blade can/cannot, and the controller authorized helper that auto-throws on denial. Shows a simple database-backed permissions mapping, warns about caching and N+1 queries, and explains super-admin handling via the before hook returns null to continue and optional after hook for overrides. Recommends packages including Spatie laravel-permissions with 3.25 million downloads and lab404/laravel-impersonate, and notes real-world usage like Zen Cart running 100,000 stores.

AI-written summary · about

  1. 0:00Intro
  2. 1:27The Problem: What I Needed
  3. 2:41Objectives
  4. 3:10Auth != Auth
  5. 4:33Authorization in Laravel
  6. 6:02Gate::define
  7. 8:45Policy Methods (return:boolean)
  8. 9:47Controller: Sthis- authorize()
  9. 11:14Policy Method with extra context
  10. 12:24Blade: @can family
  11. 16:38Storing Dynamic Permissions in the Database
  12. 17:44Registering Permissions from the Database
  13. 18:44Validation in Form Requests
  14. 19:28Front-End Clients
  15. 20:16Best-Practices
  16. 21:34When To Use Packages
  17. 22:40Popular ACL Packages
  18. 24:45Review
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.