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