← Laravel SaaS alapok csapata adatlapja
Nézd meg, miben segít
Laravel-jogosultság és validálás
Szerveroldali belépési pontokon tartatja be a bemenetellenőrzést, rekordjogokat és ügyfélhatárokat.
laravel-auth-validation
Ezt a skillt használó csapattagok
Mikor hasznos?
Akkor használd, ha védett adatot olvasó vagy módosító űrlapot készítesz.
Miben segít neked?
- Form Requestet és kifejezetten megengedett mezőket használ frissítéshez.
- Policyt, hatókörös kapcsolást és megbízható szerveres azonosítást ellenőriz.
- Védi a lekérdezést és megjelenítést a nem megbízható bemenettől.
Például ezt kérheted
Védd a rendelésfrissítést idegen ügyfélazonosítóktól, beküldött szerepkörmezőktől és jogosulatlan kapcsolt rekordoktól. Egyébként érvényes módosításba tegyél idegen címet és adminjelzőt. Mentés előtt utasítsa el a jogosulatlan változást, a védett mezők maradjanak változatlanok.
Részletes dokumentáció
Itt a skill eredeti útmutatóját, példáit és ellenőrzési szempontjait olvashatod az eredeti nyelven.
Összecsukás
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.
Csomagban lévő fájlok 2
LICENSE.txtSKILL.md
