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