Laravel Set 4
Free Online Best Laravel MCQ Questions for improve your basic knowledge of Laravel Framework. This Laravel 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 Set 4.
You scored %%SCORE%% out of %%TOTAL%%.
Your performance has been rated as %%RATING%%
Your answers are highlighted below.
Question 1 |
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 2 |
How to get current route name?
A | get()->route()->getName() |
B | request()->getName() |
C | request()->route->getRoute() |
D | request()->route->getName() |
Question 3 |
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 4 |
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 5 |
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 6 |
This helper function generates a random string of the specified length: str_XXXXXX($length)
A | |
B | |
C | |
D |
Question 7 |
Where will you define Laravel's Facades?
A | IlluminateSupportFacades namespace. |
B | IlluminatevendorFacades namespace. |
C | IlluminateappFacades namespace. |
D | IlluminatehttpFacades namespace. |
Question 8 |
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 9 |
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 10 |
Which of these commands doesn't exist?
A | php artisan cache:clear |
B | php artisan queue:clear |
C | php artisan route:clear |
D | php artisan view:clear |
Question 11 |
How can Reverse Routing in Laravel 5?
A | Config::get('login', 'users@login'); |
B | Route::get('login', 'users'); |
C | Route::get('login', 'users@login'); |
D | Route::get('login', 'usersLogin'); |
Question 12 |
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 13 |
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 14 |
After running artisan make:auth - what new controller will be generated?
A | AuthController.php |
B | RigisterController.php |
C | HomeController.php |
D | LoginController.php |
Question 15 |
In default Laravel out-of-the-box "users" DB table migration, what field is not present?
A | surname |
B | name |
C | remember_token |
D | updated_at |
Question 16 |
Which method returns the average value of a given key ?
A | average() |
B | avg() |
C | avg_val() |
D | median() |
Question 17 |
"php artisan migrate:rollback --XXXXX=5" What parameter is behind XXXXX?
A | last |
B | create |
C | step |
D | latest |
Question 18 |
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 19 |
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 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 class is used to handle exceptions?
A | AppHTTPHandler class |
B | VendorExceptionsHandler class |
C | AppExceptionsHandler class |
D | AppControllerHandler class |
Question 22 |
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 23 |
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 24 |
To enable maintenance mode, simply execute this Artisan command:
A | artisan maintenance |
B | artisan reset |
C | artisan down |
D | artisan stop |
Question 25 |
Where is the routing file located in Laravel 5?
A | app/Http/ |
B | routes/ |
C | urls/ |
D | vendors/ |
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!