Learn Laravel MCQs

Prepare Laravel MCQs (Multiple choice Questions) for exam and job interviews.

What is the command to reset all migrations in Laravel?

1) php artisan migrate:reset

2) php artisan migrate:refresh

3) php artisan migrate:rollback

4) php artisan migrate:drop

Answer : Option 1

How can you create a new test case in Laravel?

1) php artisan make:test

2) artisan create:test

3) make:test

4) create:test

Answer : Option 1

What is the purpose of the `php artisan route:clear` command?

1) Clear the route cache

2) Clear application cache

3) Clear view cache

4) Clear config cache

Answer : Option 1

How do you create a new route in Laravel?

1) Route::get()

2) Route::create()

3) php artisan make:route

4) create:route

Answer : Option 1

What is the purpose of the `app/Exceptions` directory in Laravel?

1) Store custom exceptions

2) Store controllers

3) Store middleware

4) Store routes

Answer : Option 1

How do you send a notification in Laravel?

1) Notification::send()

2) sendNotification()

3) Mail::to()

4) notification()

Answer : Option 1

What is the command to create a new command bus in Laravel?

1) php artisan make:command

2) artisan create:command

3) make:command

4) create:command

Answer : Option 1

How can you add a custom validation rule in Laravel?

1) Validator::extend()

2) addRule()

3) validate()

4) customValidation()

Answer : Option 1

What is the purpose of the `resources/lang` directory?

1) Store localization files

2) Store configuration files

3) Store views

4) Store controllers

Answer : Option 1

How do you generate a new model factory in Laravel?

1) php artisan make:factory

2) artisan create:factory

3) make:factory

4) create:factory

Answer : Option 1