Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

1. Laravel is a ____ framework?

A. PHP
B. JavaScript
C. Python
D. React

Answer: A) PHP

Explanation:

Laravel is a PHP framework.

2. Does Laravel follow the MVC concept?

A. Yes
B. No

Answer: A) Yes

Explanation:

Laravel is powerful MVC PHP framework.

3. Does Laravel follow the object-oriented approach?

A. Yes
B. No

Answer: A) Yes

Explanation:

Laravel follows the object-oriented approach.


4. Does PHP follow the object-oriented approach?

A. No
B. Yes

Answer: B) Yes

Explanation:

Yes, PHP is object-oriented programming language.

5. Who developed Laravel?

A. Yes
B. Taylor Otwell
C. Tim Berners-Lee
D. Guillermo Rauch
E. Brendan Eich

Answer: B) Taylor Otwell

Explanation:

Laravel is developed by Taylor Otwell.

6. Laravel is ____ framework?

A. Frontend
B. Backend

Answer: B) Backend

Explanation:

Laravel is a backend framework.


7. Is Laravel an open-source?

A. Yes
B. No

Answer: A) Yes

Explanation:

Laravel is an open-source framework.

8. All dependencies are specified in the ____ file, which is located in the
source folder?

A. Root
B. Config
C. composer.json

Answer: C) composer.json

Explanation:

All dependencies are specified in the composer.json file, which is located in the
source folder.

9. Command line interface used in Laravel is called ____.

A. Command Prompt
B. CLI
C. Composer
D. Artisan

Answer: D) Artisan

Explanation:
Command line interface used in Laravel is called Artisan.

10. How many built-in libraries does Laravel provides?

A. 30
B. 20
C. 100
D. 50

Answer: B) 20

Explanation:

Laravel provides 20 built-in libraries.

11. What is the name of the ORM used in Laravel?

A. Artisan
B. Composer
C. Hibernate
D. Eloquent

Answer: D) Eloquent

Explanation:

Eloquent is an object relational mapper (ORM) that comes with the Laravel
framework by default.

12. The database definitions and structure are kept in PHP code using ____.

A. Redis
B. Template engine
C. Schema Builder

Answer: C) Schema Builder


Explanation:

The database definitions and structure are kept in PHP code using Schema
Builder.

13. Which template language does Laravel use?

A. Blade
B. Cron
C. Template engine
D. Command Bus

Answer: A) Blade

Explanation:

Laravel has a simple yet powerful templating engine called Blade.

14. ____ installed on your system before you install Laravel.

A. Browser
B. Composer
C. Eloquent
D. None of the above

Answer: B) Composer

Explanation:

Composer installed on your system before you install Laravel.

15. Which folder in Laravel includes the entire source code of the project?
A. Events
B. Public
C. App
D. Console

Answer: C) App

Explanation:

App includes the entire source code of the project.


ENT

16. ____ contains the artisan commands required by Laravel.

A. Events
B. Public
C. Jobs
D. Console

Answer: D) Console

Explanation:

Console contains the artisan commands required by Laravel.

17. What is the extension of the folder which includes all the events for the
project?

A. .php
B. .txt
C. .xml
D. .laravel

Answer: A) .php

Explanation:
.php is the extension of the folder which includes all the events for the project.

18. What is the name of the file which handles all the exceptions?

A. Exception_methods.php
B. Handle.php
C. Exceptions.php

Answer: B) Handle.php

Explanation:

handle.php is the name of the file which handles all the exceptions.

19. Which folder in Laravel contains model, controllers and views defined
for the specific directories?

A. Events
B. Public
C. Jobs
D. Http

Answer: D) Http

Explanation:

Http folder in Laravel contains model, controllers and views defined for the
specific directories.

20. The ____ directory stores the actions that have been queued for the
Laravel application?

A. Events
B. Public
C. Jobs
D. Http
Answer: C) Jobs

Explanation:

The Jobs directory stores the actions that have been queued for the Laravel
application.

21. ____ are PHP classes that contain the authorization logic.

A. Policies
B. Providers
C. Http

Answer: A) Policies

Explanation:

Policies are PHP classes that contain the authorization logic.

22. The database directories in Laravel, includes how many sub-directories?

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

Answer: B) 3

Explanation:

The database directories in Laravel, includes 3 many sub-directories: Seeds,


Migrations, Factories.
23. Which of the following folder includes the classes needed for database
unit testing?

A. Seeds
B. Migrations
C. Factories.

Answer: A) Seeds

Explanation:

Seeds folder includes the classes needed for database unit testing.

24. To produce a huge number of data records, ____folder is needed?

A. Seeds
B. Migrations
C. Factories.

Answer: C) Factories.

Explanation:

To produce a huge number of data records, factories folder is needed.

25. Which of the following folder is the root folder and helps in initializing
the Laravel application?

A. Events
B. Public
C. Resources
D. Http

Answer: B) Public

Explanation:
Public folder is the root folder and helps in initializing the Laravel application.

26. The name standard for test case classes is ____, and it is based on the
functionality of the class?

A. Toggle case
B. Uppercase
C. Lowercase
D. Camel case

Answer: D) Camel case

Explanation:

The name standard for test case classes is camel case, and it is based on the
functionality of the class.

27. The ____ folder includes all the composer dependencies?

A. Events
B. Public
C. Vendor
D. Resources

Answer: C) Vendor

Explanation:

The Vendor folder includes all the composer dependencies.

28. ____are those that offer your web application with a list of web services.

A. Events
B. Environment variables
C. Routing
D. Resources

Answer: B) Environment variables

Explanation:

Environment variables are those that offer your web application with a list of web
services.

29. In which of the following file, environment variables are declared?

A. .environment
B. .env_varibales
C. .env

Answer: C) .env

Explanation:

In .env file, environment variables are declared.

30. The configuration settings are cached using which of the following
command?

A. Config_cache
B. Cache
C. Config
D. Config:cache

Answer: D) Config:cache

Explanation:

The configuration settings are cached using config:cache command.

31. All requests in Laravel are mapped using ____.


A. Data binding
B. Routes
C. ORM

Answer: B) Routes

Explanation:

All requests in Laravel are mapped using routes.

32. ____serves as a link between a request and its response.

A. Data binding
B. Routes
C. Middleware

Answer: C) Middleware

Explanation:

Middleware serves as a link between a request and its response.

33. How many types of middleware are there in Laravel?

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

Answer: D) 2

Explanation:

In Laravel there are two types of middleware:


• Global Middleware
• Route Middleware

34. Every HTTP request made by the application will trigger the ____
Middleware.

A. Global
B. Route

Answer: A) Global

Explanation:

Every HTTP request made by the application will trigger the Global Middleware.

35. The ____ Middleware will be assigned to a specific route.

A. Global
B. Route

Answer: B) Route

Explanation:

The Route Middleware will be assigned to a specific route.

36. Which of the following property is used to register Global middleware?

A. $global
B. $route
C. $middleware
D. $routemiddleware

Answer: C) $middleware
Explanation:

$middleware property is used to register Global Middleware.

37. Which of following property is used to register route specific


middleware?

A. $global
B. $route
C. $middleware
D. $routemiddleware

Answer: D) $routemiddleware

Explanation:

$routemiddleware property is used to register route specific middleware.

38. The terminate method in the middleware takes how many arguments?

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

Answer: A) 2

Explanation:

The terminate method will receive two arguments $request and $response.

39. Which of the following keyword enables developers to condense the


namespace?
A. Name
B. Taken
C. Use
D. Namespace

Answer: C) Use

Explanation:

The use keyword enables developers to condense the namespace.

40. Which of the following functions as a bridge between Views and


Models?

A. Objects
B. Data binding
C. Route
D. Controller

Answer: D) Controller

Explanation:

Controller functions as a bridge between Views and Models.

41. ____Controllers allow you to design a single route to handle all of the
controller's actions?

A. Implicit controller
B. Restful resource controller
C. Resource controller

Answer: A) Implicit controller

Explanation:
Implicit Controllers allow you to design a single route to handle all of the
controller's actions.

42. To get the specified URI, we use the "____" method.

A. Is
B. Use
C. Path
D. Link

Answer: C) Path

Explanation:

To get the specified URI, use the "path" method.

43. In how many ways you can retrieve the Input values in Laravel?

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

Answer: B) 2

Explanation:

There are two ways we can retrieve the input values:

• Using the input() method


• Using the properties of Request instance

44. How many arguments does Input method takes in Laravel?


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

Answer: A) 1

Explanation:

Input method in Laravel takes only one argument.

45. How many arguments does Cookie() method takes?

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

Answer: C) 3

Explanation:

Cookie() method takes three arguments:

• First: Name of the cookie


• Second: Value of the cookie
• Third: Duration of the cookie

46. The ____function may be used to connect the response to headers?

A. Header()
B. Router()
C. Namespace()
D. Response()

Answer: A) Header()
Explanation:

The header() function may be used to connect the response to headers.

47. Which of the following separates the application logic and the
presentation logic?

A. Model
B. View
C. Controller

Answer: B) View

Explanation:

Views separates the application logic and the presentation logic.

48. How many databases does Laravel supports?

A. 5
B. 6
C. 4
D. 7

Answer: C) 4

Explanation:

Laravel currently supports following 4 databases −

• MySQL
• Postgres
• SQLite
• SQL Server
49. Which of the following log channel driver in Laravel discards all log
messages?

A. Syslog
B. Slack
C. Single
D. Null

Answer: D) Null

Explanation:

Null log channel driver in Laravel discards all log messages.

50. ____ feature of Laravel supports different language to be used in


application.

A. Localization
B. Globalization
C. Language-app

Answer: A) Localization

Explanation:

Localization feature of Laravel supports different language to be used in


application.

51. ____ are used to store information about the user across the requests.

A. Localization
B. Memcached
C. Config
D. Sessions
Answer: D) Sessions

Explanation:

Sessions are used to store information about the user across the requests.

52. How many arguments does the Get() method takes in session?

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

Answer: B) 1

Explanation:

Get() method takes only one argument i.e., key to get the session data.

53. In Laravel which method is used to store the data in session?

A. Get()
B. Post()
C. Put()

Answer: C) Put()

Explanation:

Put() method is used to store the data in session.

54. How many arguments does put() method takes?

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

Answer: A) 2

Explanation:

Put() method takes two arguments: Key and value.

55. Which of the following method is used to delete an item from the
session?

A. Delete (0
B. Expire()
C. Forget()
D. Del()

Answer: C) Forget()

Explanation:

The forget() method is used to delete an item from the session.

56. Is forget() method and Pull() method the same thing?

A. Yes
B. No

Answer: B) NO

Explanation:

The forget() and pull() methods vary in that the forget() method does not return
the value of the session, but the pull() function returns it and deletes it from the
session.
57. Laravel uses free feature-rich library ____ to send emails?

A. SwiftMailer
B. Emailer
C. Mails

Answer: A) SwiftMailer

Explanation:

Laravel uses free feature-rich library SwiftMailer to send emails.

58. Which of the following artisan command creates all the listeners?

A. event:
B. event:listener
C. event:generate

Answer: C) event:generate

Explanation:

event:generate, artisan command creates all the listeners.

Discuss this Question

59. ____ provide a "static" interface to classes that are available in the
application service container?

A. Events
B. Facades
C. Views

Answer: B) Facades
Explanation:

Facades provide a "static" interface to classes that are available in the application
service container.

60. Are facades and helper function the same thing?

A. Yes
B. No

Answer: A) Yes

Explanation:

There is no difference between facades and helper function.

61. Laravel ____ are a set of interfaces that define the framework's basic
services?

A. Facades
B. Controller
C. Contracts
D. All of the above

Answer: C) Contracts

Explanation:

Laravel Contracts are a set of interfaces that define the framework's basic
services.

62. What do you mean by CSRF in Laravel?


A. Cross site forgery accounts
B. Criss spot forgery account
C. Cross site forgery attacks

Answer: C) Cross site forgery attacks

Explanation:

CSRF stands for cross site forgery attacks.

63. Does Laravel generate CSRF token automatically?

A. Yes
B. No

Answer: A) Yes

Explanation:

Laravel creates a CSRF "token" automatically for each active user session
controlled by the application.

64. The process of recognising the user credentials is known as ____?

A. Authorization
B. Identity management
C. Authentication

Answer: C) Authentication

Explanation:

The process of recognising the user credentials is known as authentication.


65. Which of the following commands is needed to construct forms and the
controllers connected with them in order to accomplish authentication?

A. php make:auth
B. php artisan make:auth
C. artisan make:auth

Answer: B) php artisan make:auth

Explanation:

php artisan make:auth, command is needed to construct forms and the


controllers connected with them in order to accomplish authentication.

66. ____is the controller used for authentication.?

A. HomeController
B. CallController
C. DefaultController

Answer: A) HomeController

Explanation:

HomeController is the controller used for authentication.

67. In ____, the system or web application determines whether authenticated


users may access the resources they are attempting to access or request?

A. Authorization
B. Identity management
C. Authentication

Answer: A) Authorization

Explanation:
In authorization, the system or web application determines whether
authenticated users may access the resources they are attempting to access or
request.

68. Is authorization and authentication the same thing?

A. Yes
B. No

Answer: B) NO

Explanation:

Authentication entails verifying the authenticity of the user credentials, whereas


authorization involves verifying the rights and permissions that an authenticated
user has over the resources.

Discuss this Question

69. ____are basic closures that assess whether or not a user is permitted to
execute a particular operation?

A. Gates
B. Policies

Answer: A) Gates

Explanation:

Gates are basic closures that assess whether or not a user is permitted to execute
a particular operation.

Discuss this Question


70. Policies classes arrange authorization logic around a certain model or
resource?

A. Gates
B. Policies

Answer: B) Policies

Explanation:

Policies classes arrange authorization logic around a certain model or resource.

Discuss this Question

71. Which of the following command is used to create a policy?

A. Create:policy
B. Insert:Policy
C. Make:policy
D. Generate:policy

Answer: C) Make:policy

Explanation:

The make:policy Artisan command can be used to create a policy.

72. Which of the following command is used to get a list of all possible
Artisan commands?

A. Display
B. Show
C. View
D. List

Answer: D) List
Explanation:

You may use the list command to get a list of all possible Artisan commands.

73. ____ allows you to use the command line to interact with your whole
Laravel application, including Eloquent models, jobs, events, and more?

A. Tinker
B. Artisan
C. REPL

Answer: A) Tinker

Explanation:

Tinker allows you to use the command line to interact with your whole Laravel
application, including Eloquent models, jobs, events, and more.

74. ____ is the act of turning plain text to a message using techniques that
prevents any third party from reading the information?

A. Decryption
B. Encryption

Answer: B) Encryption

Explanation:

Encryption is the act of turning plain text to a message using techniques that
prevents any third party from reading the information.

75. Which AES algorithm is used by Laravel?

A. AES-256
B. AES-128
C. Both
D. Only A
E. Only B

Answer: C) Both

Explanation:

Laravel's encrypter uses OpenSSL to provide AES-256 and AES-128 encryption.

76. The process of converting a string of characters into a shorter fixed


value or key that represents the original string is known as ____?

A. Decryption
B. Encryption
C. Hashing

Answer: C) Hashing

Explanation:

The process of converting a string of characters into a shorter fixed value or key
that represents the original string is known as hashing.

77. Is Error 403 and Error 404 the same kind of errors?

A. Yes
B. No

Answer: B) NO

Explanation:

The difference between 403 and 404 errors is that 404 is displayed when a user
attempts to access an unknown resource or URL, whereas 403 error, as shown in
the screenshot above, is presented when an unauthorized user attempts to
access the website.
78. How many attributes does artisan command expectsQuestion includes?

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

Answer: D) 2

Explanation:

expectsQuestion includes two attributes.: One with question and other with an
apiKeySecret.

79. How many parameters does Paginate method takes?

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

Answer: A) 1

Explanation:

Paginate method takes only 1 parameter i.e., number of items to be displayed in


one page.

80. Which of the following are the alternatives of Laravel?

A. Angular.
B. CodeIgniter.
C. CakePHP.
D. Phalcon.
E. All of the above

Answer: E) All of the above


Explanation:

Following are the alternatives of Laravel:

• Angular.
• CodeIgniter.
• CakePHP.
• Phalcon.

81. Which of the following is the oldest broadcasting organization who uses
Laravel?

A. Netflix
B. Facebook
C. BBC
D. IBM

Answer: C) BBC

Explanation:

BBC is the oldest broadcasting organization who uses Laravel, other companies
who uses Laravel are: 9GAG, Pfizer, TourRadar, and Crowdcube.

You might also like