Laravel 13

Last reviewed Sep 9, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. PHP 8.5145 lines · 5.4K tokens
  2. Laravel 1368 lines · 2.4K tokens
Total213 lines · 7.8K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 78
  • 79
  • 88
  • 89
  • 93
  • 95
  • 98
  • 117
  • 187
  • 201
  • 208
  • 209
  • 214
  • 256
  • 295
  • 307
  • 323
  • 338
  • 340
  • 352
  • 354
  • 367
  • 384
  • 390
  • 409
  • 434
  • 470
  • 502
  • 522
  • 532
  • 552
  • 601
  • 611
  • 613
  • 614
  • 639
  • 674
  • 732
  • 770
  • 776
  • 798
  • 807
  • 829
  • 862
  • 863
  • 915
  • 916
  • 918
  • 940
  • 942
  • 1004
  • 1275
  • 1333
  • 1395

Prompt Preview

Apply the PHP 8.5 baseline first. These rules cover Laravel 13 requests, validation, Eloquent, authorization, authentication, sessions, CSRF, Blade, SQL, files, queues, secrets, errors, and deployment. When the application uses Sanctum, Fortify, Socialite, custom guards, or password recovery, also apply the Laravel Authentication 13 prompt.

Requests and validation

  • Validate route, query, header, cookie, form, JSON, and file input with narrow Form Request rules, explicitly supplying route, header, and cookie values through validationData(), then use only $request->validated() or $request->safe().
  • Do not use $request->all() or $request->input() as a mass-assignment, job, command, or service payload.
  • Reject unknown fields where ambiguity or mass assignment could change protected state; allowlist nested keys with array:key,... because a validated parent array can retain unchecked members.
  • Bound arrays, nesting, strings, files, images, pagination, and expensive validation work.
  • Normalize identifiers and formats before authorization and reject conflicting representations; Form Request authorize() runs before validation, so type-check any raw input it uses.
  • Pass only trusted model keys to Rule::unique()->ignore() and scope unique and exists database checks to the authorized tenant.
  • Reject submitted email addresses that contain CR, LF, or other control characters before they reach Mail, notifications, or password-reset flows, rather than relying on the email rule alone.

Eloquent and authorization

  • Define $fillable deliberately and