Laravel MCQ

Laravel MCQ

  • Admin
  • 21st Feb, 2023

Take Laravel Quiz To test your Knowledge 

Practice here the best Laravel MCQ Questions, that check your basic knowledge of the Laravel Framework. This Laravel MCQ Test contains 25+ Laravel Multiple Choice Questions. Choose the right answers to check your final preparation for the Laravel Exam or Interview. Apart from this, you can also download here Laravel MCQ PDF, Completely free.

Also, Read Best Laravel Interview Questions.

Laravel MCQ Quiz & Test

1) Which method returns the average value of a given key ?

  • A. average()
  • B.avg()
  • C.median()
  • D.avg_val()

2) Bootstrap directory in Laravel is used to

  • A. Initialize a Laraval application
  • B.Call laravel library functions
  • C.Load the configuration files
  • D.Load laravel classes and models

3) Which artisan command is used to remove the compiled class file.

  • A. clear-compiled
  • B.clear compiled
  • C.compiled:clear
  • D.clear:all

4) Which method breaks the collection into multiple, smaller collections of a given size

  • A. split()
  • B.chunk()
  • C.explode()
  • D.break()

5) Artisan command to flush the application cache:

  • A. cache:flush
  • B.cache:clear
  • C.cache:forget
  • D.cache:remove
Download Free : Laravel MCQ PDF

6) The vendor directory contains

  • A. Laravel Framework code
  • B.Assets
  • C.Third-party code
  • D.Configuration files

7) Where is the routing file located in Laravel ?

  • A. app/Http/
  • B.routes/
  • C.urls/
  • D.vendors/

8) View files in Laravel end in

  • A. .blade.php
  • B..php
  • C..vue
  • D..blade

9) Which of following command is used to create a symbolic link from "public/storage" directory to "storage/app/public".

  • A. storage:link
  • B.link:public
  • C.link:storage
  • D.storage:link public/storage

10) Which of following methods are used in database migrations classes?

  • A. execute() and rollback()
  • B.up() and down()
  • C.run() and delete()
  • D.save() and update()

11) For what do the .env is used?

  • A. For setting environment variables
  • B.For running cron jobs
  • C.For tracking vendors
  • D.None of These

12) Which directory contain “robot.txt” file ?

  • A. app
  • B.public
  • C.config
  • D.storage

13) Interpolation of variable in laravel done using

  • A. compact
  • B.{{}}
  • C.helpers

14) What is the HTTP Status Code for your website. When it is down for maintenance.

  • A. 501
  • B.200
  • C.400
  • D.503

15) __() in laravel used for

  • A. Printing value
  • B.For string translation

16) Where do we need to set database connection in Laravel?

  • A. config.php
  • B.setting.php
  • C.In seed files
  • D..ENV file

17) What is the minimum PHP version required to install Laravel 5.3?

  • A. 7.1
  • B.5.6.4
  • C.5.3.2
  • D.5.4.3

18) How to set a session data in Laravel?

  • A. $request->db->session('key', 'value');
  • B.$request->session()->set('key', 'value');
  • C.$request->session()->put('key', 'value');
  • D.None of These

19) Who developed Laravel?

  • A. Rasmus Lerdorf
  • B.Taylor Otwell
  • C.James Gosling
  • D.Guido van Rossum

20) 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 --plain
  • D.php artisan make:request controller_name create

21) What is the purpose of the app/Providers directory in a Laravel project?

  • A. It stores views for the application
  • B.It stores controllers for the application
  • C.It stores routes for the application
  • D.It stores classes that provide various services to the rest of the application

22) What is the purpose of the .env file in a Laravel project?

  • A. It stores views for the application
  • B.It stores routes for the application
  • C.It stores environment-specific configuration for the application
  • D.None of the above

23) Which of the following is NOT a Laravel service container?

  • A. $db
  • B.$app
  • C.$cache
  • D.$request

24) How can you define a new route in a Laravel application?

  • A. By adding a new route to the routes/web.php file
  • B.By adding a new route to the app/Routes/web.php file
  • C.By adding a new route to the app/Routes/web.php file
  • D.By adding a new route to the app/Http/Controllers/Route.php file

25) How can you display a view in a Laravel application?

  • A. By using the view() helper function
  • B.By using the render() method of the View class
  • C.By using the display() method of the View class
  • D.Both A and B options are right

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

Ruby MCQ
Cobol MCQ
Perl MCQ
Power BI MCQ