Edu
Hub
Courses
AI Tools
Leaderboard
Login/Register
AR
Abdullah Rashid
abdullah@example.com
Navigation
📚
Courses
🏆
Leaderboard
✨
AI Tools
←
Laravel Intermediate Quiz
⏱
15:00
Quit
0 / 20 answered
0%
Laravel Intermediate Quiz
10 questions · Medium difficulty · 00:20:00 min
🔥 In Progress
Question 1
Which Laravel method is used to define a route that responds to both GET and POST requests?
Route::get('/', ...)
Route::any('/', ...)
Route::match(['get', 'post'], '/', ...)
Route::post('/', ...)
Question 2
What is the purpose of the 'php artisan migrate:rollback' command?
Creates a fresh migration file
Rolls back the last migration operation
Runs pending migrations
Deletes all database tables
Question 3
Which middleware is automatically applied to all web routes in Laravel by default?
auth
api
web
StartSession
Question 4
In Eloquent, which method is used to define a many-to-many relationship?
belongsTo()
hasMany()
belongsToMany()
hasOne()
Question 5
What does the 'php artisan make:model Post -m' command do?
Creates a migration and a seeder
Creates a controller and a model
Creates a model and a seeder
Creates a model and a migration file
Question 6
Which Blade directive is used to include a sub-view?
@include
@component
@section
@extends
Question 7
What is the default queue connection configured in Laravel's config/queue.php?
database
sync
null
redis
Question 8
Which method is used to validate incoming request data in a controller?
check()
validate()
confirm()
sanitize()
Question 9
How do you retrieve the currently authenticated user in Laravel?
Auth::check()
Session::get('user')
request()->user()
auth()->user()
Question 10
Which Laravel feature allows you to write expressive and fluent database queries using PHP syntax?
Eloquent ORM
Database Migrations
Query Builder
Schema Builder
Question 11
What is the purpose of the 'php artisan tinker' command?
Runs database seeds
Compiles Blade templates
Provides an interactive REPL for Laravel
Clears application cache
Question 12
Which facade is used to generate URLs in Laravel?
Redirect
Response
URL
Route
Question 13
In Laravel, what does the 'php artisan storage:link' command create?
A database storage engine
A symbolic link from public/storage to storage/app/public
A cached storage directory
A new storage disk configuration
Question 14
Which method is used to define an accessor in an Eloquent model?
get{Attribute}Attribute
fillable
mutator
set{Attribute}Attribute
Question 15
What is the role of service providers in Laravel?
They handle HTTP requests and responses
They are the central bootstrapping for all Laravel services
They manage database connections
They define routes for the application
Question 16
Which Blade directive is used to define a layout section that can be overridden by child views?
@section
@include
@extends
@yield
Question 17
How do you pass data to all views in a Laravel application?
Using Route::param()
Using config('app.data')
Using Session::flash()
Using View::share() in a service provider
Question 18
Which Laravel method is used to abort a request with a custom HTTP response?
halt()
abort()
stop()
die()
Question 19
What does the 'php artisan route:list' command do?
Generates a new route file
Caches the route definitions
Tests all routes for errors
Displays all registered routes
Question 20
Which of the following is a valid way to define a middleware that runs on every request?
Use the 'middleware' method in a controller constructor
Set it in the .env file
Add it to the route group middleware property
Register it in the 'middleware' array in app/Http/Kernel.php
✅ Answered:
0
⬜ Unanswered:
8
📊
20%
done
Submit Answers →