โ† All LARAVEL Flashcard Decks

LARAVEL Authentication & Security Flashcards

6 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 6 LARAVEL Authentication & Security flashcards as text
  1. What does Laravel's `encrypt()` helper do?

    Answer: Encrypts a value using AES-256-CBC with the application's APP_KEY

    The encrypt() helper uses Laravel's Encrypter service to AES-256-CBC encrypt a payload, also signing it to prevent tampering.

  2. Which config file defines the default authentication guard and user provider in Laravel?

    Answer: config/auth.php

    config/auth.php contains the guards, providers, and password broker configuration that controls how users are authenticated.

  3. What is the difference between the `web` and `api` authentication guards in Laravel?

    Answer: web uses session/cookie storage while api uses token-based stateless authentication

    The web guard maintains state via session cookies, whereas the api guard is stateless and authenticates each request via a token.

  4. What does the `verified` middleware do in Laravel?

    Answer: Restricts access to users who have verified their email address

    The verified middleware checks the email_verified_at timestamp and redirects unverified users to the email verification notice page.

  5. How does Laravel protect against SQL injection when using Eloquent or the query builder?

    Answer: By using PDO parameter binding for all query values automatically

    Eloquent and the query builder pass all user-supplied values as bound parameters via PDO, preventing SQL injection by design.

  6. What is the purpose of the `APP_KEY` value in Laravel's `.env` file?

    Answer: It is the encryption key used by the Encrypter for all encrypt/decrypt and cookie signing operations

    APP_KEY is the 32-byte AES encryption key used by Laravel's Encrypter class to secure cookies, encrypted values, and signed URLs.

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