โ† All LARAVEL Flashcard Decks

Ultimate Laravel Flashcards

7 cards from real LARAVEL practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Ultimate Laravel flashcards as text
  1. In Laravel's queue system, what happens to a job when its `tries` limit is exceeded?

    Answer: It is moved to the 'failed_jobs' table

    After all retry attempts are exhausted, Laravel moves the failed job's payload to the `failed_jobs` database table for inspection.

  2. Which HTTP verb does a Laravel resource route use for the `update` action?

    Answer: PUT or PATCH

    Laravel resource routing maps both `PUT` and `PATCH` requests to the `update` controller action, with `PATCH` for partial updates.

  3. What is the purpose of Laravel Sanctum compared to Laravel Passport?

    Answer: Sanctum provides lightweight token and SPA authentication; Passport is full OAuth2 server

    Sanctum is a simple, lightweight package for SPA cookies and API tokens, while Passport implements a full OAuth2 server for third-party token issuance.

  4. Which Blade directive is used to escape and output a variable to prevent XSS?

    Answer: {{ $variable }}

    Double curly braces `{{ }}` automatically run `htmlspecialchars` on the value, while `{!! !!}` outputs raw unescaped HTML.

  5. In Laravel, what does the `DB::transaction()` method guarantee when an exception is thrown inside its callback?

    Answer: All database operations inside the callback are rolled back automatically

    If any exception is thrown inside `DB::transaction()`, Laravel automatically rolls back all queries executed within that callback.

  6. Which Laravel testing method asserts that a specific job was pushed onto a queue during a test?

    Answer: Queue::assertPushed() and Bus::assertDispatched() both work depending on facade used

    `Queue::assertPushed()` works after `Queue::fake()` and `Bus::assertDispatched()` works after `Bus::fake()`, both verifying job dispatch in tests.

  7. What is the purpose of the `RetryUntil` method (or `$retryUntil` property) on a queued job class?

    Answer: Specifies the absolute DateTime after which the job should no longer be retried

    `retryUntil()` returns a `DateTime` instance; Laravel will not retry the job after that point in time, regardless of the `tries` count.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy