Laravel 7 Set 4
Free Online Best Laravel MCQ Questions for improve your basic knowledge of Laravel Framework. This Laravel 7 Set 4 test that contains 25 Multiple Choice Questions with 4 options. You have to select the right answer to a question.
Start
Congratulations - you have completed Laravel 7 Set 4.
You scored %%SCORE%% out of %%TOTAL%%.
Your performance has been rated as %%RATING%%
Your answers are highlighted below.
Question 1 |
How to Install Laravel via Composer?
A | composer create-project --prefer-dist laravel/laravel myproject |
B | composer run-project --prefer-dist laravel/laravel myproject |
C | composer make-project --prefer-dist laravel/laravel myproject |
D | composer install-project --prefer-dist laravel/laravel myproject |
Question 2 |
Where will you define Laravel's Facades?
A | IlluminateSupportFacades namespace. |
B | IlluminatevendorFacades namespace. |
C | IlluminateappFacades namespace. |
D | IlluminatehttpFacades namespace. |
Question 3 |
Where is the routing file located in Laravel 7?
A | app/Http/ |
B | routes/ |
C | urls/ |
D | vendors/ |
Question 4 |
How many migration files from "database/migrations" folder are run while doing "php artisan migrate"?
A | All available files in that folder |
B | One last file, ordered alphabetically |
C | Only the ones that are not in migrations DB table |
D | You have to specify parameter |
Question 5 |
What command will show you all available routes in Laravel?
A | artisan route:list |
B | artisan route:all |
C | artisan route:get |
D | artisan routes |
Question 6 |
How to use select query in Laravel?
A | DB::get('select * from users where city_id = ?', 10); |
B | DB::select('select * from users where city_id = ?', 10); |
C | DB::find('select * from users where city_id = ?', 10); |
D | DB::selectuser('select * from users where city_id = ?', 10); |
Question 7 |
Which class is used to handle exceptions?
A | AppHTTPHandler class |
B | VendorExceptionsHandler class |
C | AppExceptionsHandler class |
D | AppControllerHandler class |
Question 8 |
How to get current route name?
A | get()->route()->getName() |
B | request()->getName() |
C | request()->route->getRoute() |
D | request()->route->getName() |
Question 9 |
Which command will roll back all of your migrations and then execute the migrate command?
A | migrate:reset |
B | migrate:refresh |
C | migrate:rollback |
D | migrate:seed |
Question 10 |
If you write "Auth::routes();" in your Routes file, what route is NOT included in this function?
A | homepage |
B | login |
C | logout |
D | password.reset |
Question 11 |
How to use delete Statement in Laravel?
A | DB::deleteUser('delete from users where id = ?', [1015]); |
B | DB::delete('insert from users where id = ?', [1015]); |
C | DB::deleteInfo('delete from users where id = ?', [1015]); |
D | DB::delete('delete from users where id = ?', [1015]); |
Question 12 |
What is Laravel Artisan command to delete all the DB tables and run migrations again from scratch?
A | php artisan migrate:fresh |
B | php artisan migrate:seed |
C | php artisan migrate:rollback |
D | php artisan migrate --force |
Question 13 |
"php artisan migrate:rollback --XXXXX=5" What parameter is behind XXXXX?
A | last |
B | create |
C | step |
D | latest |
Question 14 |
How can Reverse Routing in Laravel 7?
A | Config::get('login', 'users@login'); |
B | Route::get('login', 'users'); |
C | Route::get('login', 'users@login'); |
D | Route::get('login', 'usersLogin'); |
Question 15 |
How to list all routes by terminal?
A | php artisan routes |
B | php artisan getroutes |
C | php artisan route:list |
D | php artisan listroutes |
Question 16 |
What is the name of default Laravel Middleware to restrict only logged in users to access the page?
A | auth |
B | user |
C | logged_in |
D | admin |
Question 17 |
Which method returns the average value of a given key ?
A | average() |
B | avg() |
C | avg_val() |
D | median() |
Question 18 |
How to create a controller in laravel by cmd?
A | php artisan make: generate controller contoller_name |
B | php artisan make:controller generate |
C | php artisan make:controller --user |
D | php artisan make:request controller_name create |
Question 19 |
To enable maintenance mode, simply execute this Artisan command:
A | artisan maintenance |
B | artisan reset |
C | artisan down |
D | artisan stop |
Question 20 |
After running "artisan down", your project will show maintenance page. What HTTP Status Code it would return?
A | 503 |
B | 200 |
C | 404 |
D | 500 |
Question 21 |
Which of these commands doesn't exist?
A | php artisan view:clear |
B | php artisan cache:clear |
C | php artisan queue:clear |
D | php artisan route:clear |
Question 22 |
Command "php artisan make:model" generates a new Model file into which folder?
A | public/ |
B | app/Http/Models/ |
C | app/Models/ |
D | app/ |
Question 23 |
After running artisan make:auth - what new controller will be generated?
A | AuthController.php |
B | RigisterController.php |
C | HomeController.php |
D | LoginController.php |
Question 24 |
If you create your own custom Middleware class, in which file you need to register it?
A | config/app.php |
B | app/Http/Middleware.php |
C | app/Http/Kernel.php |
D | .env |
Question 25 |
This helper function generates a random string of the specified length: str_XXXXXX($length)
A | |
B | |
C | |
D |
Once you are finished, click the button below. Any items you have not completed will be marked incorrect.
Get Results
There are 25 questions to complete.
← |
List |
→ |
Return
Shaded items are complete.
1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 |
End |
Return
You have completed
questions
question
Your score is
Correct
Wrong
Partial-Credit
You have not finished your quiz. If you leave this page, your progress will be lost.
Correct Answer
You Selected
Not Attempted
Final Score on Quiz
Attempted Questions Correct
Attempted Questions Wrong
Questions Not Attempted
Total Questions on Quiz
Question Details
Results
Date
Score
Hint
Time allowed
minutes
seconds
Time used
Answer Choice(s) Selected
Question Text
All done
Need more practice!
Keep trying!
Not bad!
Good work!
Perfect!