PHP Laravel MCQ Questions & Answers

Laravel MCQs : This section focuses on "Laravel" PHP Framework. These Multiple Choice Questions (MCQ) should be practiced to improve the PHP Laravel skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.

1. Which of the following is true about Laravel?

A. Laravel is an open-source PHP framework
B. Laravel is robust
C. Laravel is easy to understand
D. All of the above

View Answer


2. Command line interface used in Laravel is called?

A. composer
B. Artisan
C. Symphony
D. ORM

View Answer


3. ORM (Object Relational Mapper) and ActiveRecord implementation called?

A. Eloquent
B. Query Builder
C. Schema Builder
D. Blade Template

View Answer


4. Laravel uses ___________ to connect to an existing session and general-purpose cache

A. Queues
B. Cron
C. Redis
D. Command Bus

View Answer


5. ______________ acts as a bridge between a request and a response.

A. Routing
B. Middleware
C. Namespaces
D. Request

View Answer


6. Which command is used to create Middleware?

A. php make:middleware <middleware-name>
B. php artisan middleware <middleware-name>
C. php middleware <middleware-name>
D. php artisan make:middleware <middleware-name>

View Answer


7. How many types of Middleware in Laravel?

A. 2
B. 3
C. 4
D. 5

View Answer


8. The _______________ will run on every HTTP request of the application

A. Global Middleware
B. Route Middleware
C. Both A and B
D. None of the above

View Answer


9. ________________ can be defined as a class of elements in which each element has a unique name to that associated class.

A. Routing
B. Cookie
C. Namespaces
D. Request

View Answer


10. Which keyword allows the developers to shorten the namespace?

A. extend
B. use
C. artisan
D. class

View Answer


11. In the MVC framework, the letter 'C' stands for?

A. Cookie
B. Configuration
C. command prompt
D. Controller

View Answer


12. Execute the below command to create a new controller called?

php artisan make:controller UriController –plain

A. UrlController
B. pathController
C. UriController
D. routeController

View Answer


13. Cookie can be created by global cookie helper of Laravel.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


14. The cookie can be attached to the response using the ?

A. isCookie() method
B. withCookie() method
C. getCookie() method
D. putCookie() method

View Answer


15. How many arguments cookie() method will take?

A. 2
B. 4
C. 1
D. 3

View Answer


16. By default, all cookies generated by Laravel are encrypted and signed so that they can not be modified or read by the client.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


17. Which method will automatically convert the array into appropriate json response?

A. application.json
B. json
C. routes
D. test

View Answer


18. In MVC framework, the letter "V" stands for Value. 

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


19. Which version introduces the concept of using Blade?

A. Laravel 2.1
B. Laravel 3.1
C. Laravel 4.1
D. Laravel 5.1

View Answer


20. Laravel uses the Blade @extends directive for defining the child elements

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer





Discussion



* You must be logged in to add comment.