Olete.in
Articles
Mock Tests
🧪 Laravel MCQ Quiz Hub
Laravel MCQ (Multiple Choice Question) Set 1
Choose a topic to test your knowledge and improve your Laravel skills
1. Who Created Laravel?
Margon Stan
Taylor Otwell
Samsy Twig
None of these
2. What is the use of .env file in Laravel?
Setting Up local Environment variable
Optimization
Hosting
None of these
3. Command to start Laravel Application?
php artisan new
php artisan
php artisan start
php artisan serve
4. Command to install laravel project?
composer create-project laravel/laravel myproject
composer new-project laravel/laravel myproject
composer create-project new laravel/laravel myproject
None of these
5. By default laravel project runs on which PORT?
3000
5000
8000
7000
6. CLI Command to migrate in Laravel project?
php artisan create migration
php artisan migrate
php artisan serve
None of these
7. Command to get the route list in Laravel?
php artisan list
php artisan route:list
php artisan route
php artisan list:all
8. CLI Command to create controller in laravel?
php artisan make:controller Mycontroller
php artisan create:controller Mycontroller
php artisan controller Mycontroller
None of these
9. Command to make migration in laravel?
php artisan migration table
php artisan make:migration create_tags_table
php artisan make-migration digit
None of these
10. Command to check the status of migration in laravel application?
php artisan migration status
php artisan status
php artisan migrate:status
None of These
11. Command to roll back migration operation in laravel?
php artisan rollback
php artisan migration:rollback
php artisan migrate:rollback
php artisan rollback migration
12. Command to rollback all migrations operations?
php artisan migrate:reset
php artisan migration:reset
php artisan reset
php artisan reset:migration
13. In which file we can set database connections?
database.php file
config.php file
.env file
None of these
14. Can laravel application support caching?
Yes
No
Can't Say
None of these
15. What is laravel?
Framework
Programming Language
Code Editor
None of these
16. Command to check the current version of the Laravel Framwork?
php artisan main --version
php artisan --version status
php artisan check --version
php artisan --version
17. Command to check the current version of the Laravel Framwork?
php artisan main --version
php artisan --version status
php artisan check --version
php artisan --version
18. Command to create middleware in laravel application?
php artisan make:middleware Mymiddleware
php artisan middleware Mymiddleware
php artisan create:middleware Mymiddleware
php artisan middleware:make Mymiddleware
19. What are the ways to get the data from database in laravel?
Query Builder
Eloquent ORM
both a and b
None of These
20. Full form of ORM in laravel?
Object Relation Mapping
Object Relation Master
Object Relation Manager
None of These
21. Laravel is based on which design pattern?
Singleton Design Pattern
MVC(Model View Controller) Pattern
Factory Design pattern
Observer pattern
22. which command is used to clear the cache in laravel?
php artisan cache:clear
php artisan cache:clearall
php artisan clear:cache
None of These
23. In which folder .htaccess file is located in laravel?
model
controller
route
public
24. In which directory robots.txt file is located?
models
public
views
controllers
25. Which command is used to cache configuration in laravel?
php artisan cache:everything
php artisan cache:config
php artisan config:cache_all
php artisan config:cache
26. Command to enable maintenance mode in laravel?
php artisan down
php artisan down:maintenance
php artisan maintenance
None of these
27. Command to Disable Maintenance Mode in laravel?
php artisan up
php artisan up:maintenance
php artisan up:live
None of These
28. The vendor directory contains in laravel?
Bootstrap dependencies
Laravel dependencies
Composer dependencies
None of These
29. Method to determine if the user is authenticated?
Auth::check()
Auth::user()
Auth::authenticated()
None of the these
30. Method to logout authenticated user in laravel?
Auth::signout();
Auth::logout();
Auth::forgot();
None of these
31. Method to logout authenticated user from other devices in laravel?
Auth::logoutOtherDevices($currentPassword);
Auth::logoutAllDevices($currentPassword);
Auth::logout($currentPassword);
None of these
32. Method to create Hash password in laravel?
$hashed = Hash::create('has-text');
$hashed = Hash::all('has-text');
$hashed = Hash::make('has-text');
None of these
33. Which method returns the average value of a given key ?
average()
avg()
median()
avg_val()
34. Bootstrap directory in Laravel is used to
Initialize a Laraval application
Call laravel library functions
Load the configuration files
Load laravel classes and models
35. Which artisan command is used to remove the compiled class file.
clear-compiled
clear compiled
compiled:clear
clear:all
36. Which artisan command is used to remove the compiled class file.
clear-compiled
clear compiled
compiled:clear
clear:all
37. Which method breaks the collection into multiple, smaller collections of a given size
split()
chunk()
explode()
break()
38. Artisan command to flush the application cache:
cache:flush
cache:clear
cache:forget
cache:remove
39. The vendor directory contains
Laravel Framework code
Assets
Third-party code
Configuration files
40. For what do the .env is used?
For setting environment variables
For running cron jobs
For tracking vendors
None of these
41. Which directory contain “robot.txt” file ?
app
public
config
storage
42. Interpolation of variable in laravel done using
compact
{{}}
helpers
None of these
43. What is the HTTP Status Code for your website. When it is down for maintenance.
501
200
400
503
44. __() in laravel used for
Printing value
For string translation
both (a) and (b)
None of these
45. Where do we need to set database connection in Laravel?
config.php
setting.php
In seed files
.ENV file
46. What is the minimum PHP version required to install Laravel 5.3?
7.1
5.6.4
5.3.2
5.4.3
47. How to set a session data in Laravel?
$request->db->session('key', 'value');
$request->session()->set('key', 'value');
$request->session()->put('key', 'value');
None of These
48. Who developed Laravel?
Rasmus Lerdorf
Taylor Otwell
James Gosling
Guido van Rossum
49. Who developed Laravel?
Rasmus Lerdorf
Taylor Otwell
James Gosling
Guido van Rossum
50. How to create a controller in laravel by cmd?
php artisan make: generate controller contoller_name
php artisan make:controller generate
php artisan make:controller --plain
php artisan make:request controller_name create
Submit