TF
True/False
MC
Multiple
MA
Matching
CO
Comprehension
Question
Answer
Level
Subject
Time
Which language does laravel use?
Java
PhP
SQL
C
Easy
Routes
01:00
Which method is used to redirect one URI to another?
Route::redirect()
Route::to()
Route::move()
Route::send()
Very Easy
Routes
01:00
How do you define a route that responds to all HTTP verbs?
Route::all()
Route::global()
Route::any()
Route::every()
Easy
Routes
01:00
Which character is used to define an optional parameter in a route?
*
?
!
$
Very Easy
Routes
01:00
Where are the web-specific routes defined in a default Laravel installation?
api.php
console.php
channels.php
web.php
Very Easy
Routes
02:40
Which method allows you to limit a route to only HTTPS?
->secure()
->encrypted()
->ssl()
->https()
Medium
Routes
02:00
Which Artisan command is used to create a controller with CRUD methods?
make:controller --all
make:controller --resource
make:controller --crud
make:controller --api
Very Easy
Controllers
01:00
What magic method is called for a Single Action Controller?
__invoke()
__call()
__construct()
__handle()
Easy
Controllers
01:00
In which directory are Controllers stored by default?
app/Controllers
app/Base/Controllers
app/Http/Controllers
routes/Controllers
Very Easy
Controllers
01:00
How can you exclude the "show" method from a Resource Controller?
->only(["show"])
->hide(["show"])
->remove(["show"])
->except(["show"])
Easy
Controllers
02:00
What is the purpose of the "constructor" in a controller?
Dependency injection and shared logic
Defining the routes
Rendering the view directly
Handling database migrations
Medium
Controllers
02:00
How do you name a route so it can be referenced easily in Blade?
->identify()
->label()
->name()
->alias()
Very Easy
Routes
01:00
Which route method is used to respond to a form submitted via PUT?
Route::update()
Route::set()
Route::patch()
Route::put()
Easy
Routes
01:00
What is the purpose of the "fallback" route?
To handle 404 errors when no other route matches
To redirect all traffic to the homepage
To cache the route list
To define API-only endpoints
Medium
Routes
01:00
Which helper function is used to generate a URL for a named route?
link()
route()
url_path()
named()
Very Easy
Routes
01:00
How can you apply a middleware to a group of routes?
Route::secure()
Route::wrap()
Route::middleware()
Route::filter()
Easy
Routes
02:00
What does the --api flag do when creating a resource controller?
Adds database migrations
Creates a Slim controller
Generates authentication logic
Excludes create and edit methods
Easy
Controllers
01:00
Which method is typically used to process data from a "Create" form?
index()
store()
update()
patch()
Very Easy
Controllers
01:00
How do you access the current request data inside a controller method?
Type-hint the Request class in the method
Use the $_POST variable
Call Request::all() statically
It is automatically available as $data
Very Easy
Controllers
01:00
What is the correct way to return a JSON response from a controller?
return json($array)
return $array->toJson()
return response()->json($array)
echo json_encode($array)
Easy
Controllers
01:00
In a Resource controller, which method is used to display a specific record?
show()
view()
find()
display()
Very Easy
Controllers
01:00