Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to cache the routes in a Laravel application.
Laravel
php artisan [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'cache:clear' instead of 'route:cache'.
Confusing route caching with config caching.
✗ Incorrect
The command 'php artisan route:cache' caches the routes to improve performance.
2fill in blank
mediumComplete the code to clear the route cache in Laravel.
Laravel
php artisan [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'cache:clear' which clears all caches, not just routes.
Using 'route:cache' which caches routes instead of clearing.
✗ Incorrect
The command 'php artisan route:clear' clears the cached routes.
3fill in blank
hardFix the error in the artisan command to cache routes by completing the missing part.
Laravel
php artisan [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'route:list' which only lists routes.
Using 'cache:clear' which clears caches instead of caching.
✗ Incorrect
The correct command to cache routes is 'php artisan route:cache'.
4fill in blank
hardFill both blanks to create a route cache command with a specific environment in Laravel.
Laravel
php artisan [1] --env=[2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'route:clear' instead of 'route:cache'.
Using 'local' environment instead of 'production' for caching.
✗ Incorrect
The command 'php artisan route:cache --env=production' caches routes for the production environment.
5fill in blank
hardFill all three blanks to create a command that caches routes and clears config cache in Laravel.
Laravel
php artisan [1] && php artisan [2] && php artisan [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up 'config:clear' and 'config:cache'.
Using 'cache:clear' which clears all caches.
✗ Incorrect
The command runs 'route:cache' to cache routes, 'route:clear' to clear route cache, and 'config:cache' to cache config.