WorksheetsAWD - Midterm Quiz
Total questions: 15
Worksheet time: 15mins
In which file is the application's route file defined in Laravel?
routes/api.php
routes/console.php
routes/web.php
routes/middleware.php
How is web.php file created or generated in Laravel?
Manually by the developer
Automatically by the Laravel framework
Through artisan commands
By configuring the routes.php file
What is the purpose of the web.php file in Laravel?
Defining routes for API endpoints
Defining routes for console commands
Defining routes for web pages and HTTP requests
Defining database for routes
Which of the following is NOT a characteristic of REQUIRED PARAMETERS for web application routing?
Optional to capture
Mandatorily captured
Essential for routing
User identification number
How can developers make parameters optional in the URL?
By using a default value for parameters
By excluding parameters from the URL
By including a "?" after the parameter name
By making parameters mandatory
What is the main advantage of using the blade template engine in Laravel?
Faster database queries
Automatic form validation
Easy creation of master or main templates
Improved routing system
How does Laravel recognize blade templates?
By adding laravel in the name of the file
By using the public folder to save the files
By adding a specific tag to the template
By checking for a .blade.php extension
Where are all the blade templates stored in a Laravel application?
public/views
app/views
resources/templates
resources/views
What is required to extend a master template in a blade file?
@extends directive
@include directive
@extend directive
@master directive
Which syntax is used to display a variable inside a Blade view?
[ $variable ]
{{ $variable }}
{ $variable }
@variable
Where are Controllers typically stored in a Laravel project?
app/Models
app/Http/Routes
app/Views
app/Http/Controllers
Which command is used to create a controller using the Artisan CLI?
php artisan create:controller <controller-name>
php artisan make:controller <controller-name>
php create:controller <controller-name>
php make:controller <controller-name>
what is the correct syntax for using a controller in the routes/web.php file?
Route::get('/', [controller_name::class, 'class_name']);
Route::create('/', [controller_name::class, 'class_name']);
Route::controller('/', [controller_name::class, 'class_name']);
Route::add('/', [controller_name::class, 'class_name']);
Which HTTP method is typically employed when submitting data to a website?
GET
PATCH
POST
OPTIONS
What does the Illuminate\Http\Request instance provide in Laravel?
Access to database connections
Access to file storage
A rich set of methods to get information about the current HTTP request
Access to Laravel configuration files
