Bird
0
0

You want to use the database cache driver but store cache in a custom table named custom_cache. How do you configure this in Laravel's cache settings?

hard📝 component behavior Q9 of 15
Laravel - Configuration and Environment
You want to use the database cache driver but store cache in a custom table named custom_cache. How do you configure this in Laravel's cache settings?
A'database' => ['driver' => 'database', 'connection' => 'custom_cache'],
B'database' => ['driver' => 'database', 'store' => 'custom_cache'],
C'database' => ['driver' => 'database', 'cache_table' => 'custom_cache'],
D'database' => ['driver' => 'database', 'table' => 'custom_cache'],
Step-by-Step Solution
Solution:
  1. Step 1: Identify cache store config for database driver

    The database cache store requires a 'table' key to specify the cache table.
  2. Step 2: Set the custom table name

    Assign 'table' => 'custom_cache' to use the custom table.
  3. Final Answer:

    'database' => ['driver' => 'database', 'table' => 'custom_cache'] -> Option D
  4. Quick Check:

    Use 'table' key to set cache table name [OK]
Quick Trick: Use 'table' key to set database cache table [OK]
Common Mistakes:
  • Using 'connection' instead of 'table'
  • Using 'cache_table' key
  • Using 'store' key incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Laravel Quizzes