Laravel MCQ Questions

Laravel MCQ Questions | Freshers & Experienced

  • Luděk Načev
  • 13th Feb, 2021

We have listed here Best Laravel MCQ Questions for your basic knowledge of Laravel. This Laravel MCQ Test contains 25 multiple-choice questions. You have to select the right answer to every question.

Laravel MCQ Questions

1) Laravel is based on _____________________

  • A. MVVM Design Pattern
  • B.MVC Design Pattern
  • C.Singleton Design Pattern
  • D.Composite Design Pattern

2) Which of following Collection method returns all records from Laravel collection?

  • A. ->all()
  • B.->get()
  • C.->where()
  • D.->whereAll()

3) Which one Laravel command line interface?

  • A. CLI
  • B.php artisan
  • C.composer
  • D.git

4) Which command is used to start laravel server

  • A. php artisan serve
  • B.php artisan start
  • C.php artisan start-server
  • D.php artisan project_name

5) Which of following command is used to remove the compiled class file in Laravel?

  • A. php artisan clear-class
  • B.php artisan clear-compiled
  • C.php artisan down
  • D.php artisan inspire

6) How to list all routes by terminal?

  • A. php artisan routes
  • B.php artisan getroutes
  • C.php artisan route:list
  • D.php artisan listroutes

7) How to redirect to another page in Laravel?

  • A. return redirect::toview('/name')
  • B.return redirect('/name')
  • C.return redirect::('/name')

8) What is it Blade?

  • A. Template Engine
  • B.package
  • C.view file
  • D.framework

9) What is @yield used for?

  • A. to display the contents of a given section.
  • B.to extend an layout
  • C.to include a file
  • D.All of the above

10) How to define an mutator in Laravel?

  • A. setNameAttribute method inside model
  • B.setNameAttribute method inside controller
  • C.setMutator method inside controller
  • D.None of them

11) In Laravel Interpolation done by using below which symbol/ file?

  • A. {{}}
  • B.helpers
  • C.compact
  • D.None of the above

12) Which artisan command is used to remove the compiled class file?

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

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

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

14) ..........() in laravel used for

  • A. Printing value
  • B.For string translation
  • C.Both Printing value & string translation
  • D.None of the above

15) Bootstrap directory in Laravel is used to ..............

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

16) Which of the following method breaks the collection into multiple, smaller collections of a given size?

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

17) Which Artisan command is used to flush the application cache?

  • A. cache:clear
  • B.cache:flush
  • C.cache:forget
  • D.cache:remove

18) What does the vendor directory contains?

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

19) The routing file located is ............ in Laravel.

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

20) The View files in Laravel end in ........

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

21) Which methods are used in database migrations classes?

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

22) ......... directory contain “robot.txt” file.

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

23) In which file we need to set the database connection in Laravel?

  • A. .ENV file
  • B.setting.php
  • C.In seed files
  • D.None of the above

24) Who developed Laravel?

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

25) .......... is the HTTP Status Code for your website, when it's down for maintenance.

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

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Feb
React JS MCQ
01st
Feb
Angular Js MCQ
01st
Feb
Angular 2 MCQ
01st
Feb
JSON MCQ
01st
Feb
PHP MCQ
01st
Feb
JQuery MCQ