← Laravel SaaS alapok csapata adatlapja

Skill · 1.0.0 verzió

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

Nézd meg, miben segít

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.

Részletek…Összecsukás

Laravel Authorization & Validation

Form Request validation and mass assignment

  • Validate incoming input in dedicated FormRequest classes (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([...]) to create(), update() or fill(). 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 $fillable or 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 trust tenant_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() or DB::raw(); always pass bindings (whereRaw('price > ?', [$min])) and whitelist column and direction names before orderBy().
  • Keep Blade {{ $value }} escaping; use {!! $html !!} only for sanitized, trusted HTML. Ensure @csrf and throttle: rate limiters protect state-changing and auth routes.

Csomagban lévő fájlok 2

  • LICENSE.txt
  • SKILL.md