laravel-security
Installation
SKILL.md
Laravel Security
Priority: P0 (CRITICAL)
Workflow: Secure Resource
- Generate policy —
php artisan make:policy PostPolicy --model=Post. - Implement policy methods — Return
boolforview,update,deleteactions. - Authorize in controller — Call
$this->authorize('update', $post). - Add Gate bypass — Define
Gate::before()for admin users inAuthServiceProvider. - Validate inputs — Use Form Request with
$request->validated()forModel::create().
Policy Example
See implementation examples for Policy class with controller authorization.