← Zurück zu Website-Bauer
Entdecke, wie der Skill hilft
Laravel-Rechte und Validierung
Erzwingt geprüfte Eingaben, Datensatzrechte und Mandantengrenzen an serverseitigen Laravel-Einstiegspunkten.
laravel-auth-validation
Teammitglieder mit diesem Skill
Wann ist der Skill hilfreich?
Nutze diesen Skill für Formulare und Endpunkte mit geschützten Daten.
Wobei hilft er dir?
- Verwendet Form Requests und ausdrücklich erlaubte Änderungsfelder.
- Prüft Policies, begrenzte Bindungen und vertrauenswürdigen Serverkontext.
- Schützt Abfragen und Darstellung vor ungeprüften Eingaben.
Das könntest du fragen
Sichere unsere Bestelländerung gegen fremde Kundenkennungen, eingeschleuste Rollenfelder und unberechtigte Unterdatensätze. Sende eine sonst gültige Änderung mit fremder verschachtelter Adresse und Admin-Flag. Lehne unerlaubte Änderungen vor Speicherung ab; geschützte Felder bleiben unverändert.
Ausführliche Dokumentation
Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.
Weniger anzeigen
Laravel Authorization & Validation
Form Request validation and mass assignment
- Validate incoming input in dedicated
FormRequestclasses (rules(),authorize(), custom messages), following the project's rule format (array or pipe-delimited,Rule::enum(),Rule::exists()->where(...)scoped to the current tenant). - Pass only
$request->validated()or$request->safe()->only([...])tocreate(),update()orfill(). Never pass$request->all(),$request->input()or$request->except()into mass assignment. - Keep sensitive attributes (
role,is_admin,tenant_id,user_id,balance,status) out of$fillableor set them explicitly on the model from verified server context.
Policies, Gates and tenant isolation
- Enforce authorization on the server for every mutated or read resource via Policies (
$this->authorize(),Gate::authorize(),->can()route middleware). Never trusttenant_id,user_id, ownership or roles sent in the request payload. - Scope nested route model bindings with
->scopeBindings()so child records cannot be accessed across parent resources. - Never treat an Eloquent global scope alone as complete authorization: verify how tenant and user context are resolved in HTTP requests, CLI commands and queued jobs, and check Policies explicitly.
Query and output safety
- Never interpolate user input into
whereRaw(),selectRaw(),orderByRaw()orDB::raw(); always pass bindings (whereRaw('price > ?', [$min])) and whitelist column and direction names beforeorderBy(). - Keep Blade
{{ $value }}escaping; use{!! $html !!}only for sanitized, trusted HTML. Ensure@csrfandthrottle:rate limiters protect state-changing and auth routes.
Enthaltene Dateien 2
LICENSE.txtSKILL.md
