- 31st May, 2022
- 1065 Followers
Latest MCQ Tests
Pratice HR Questions
Laravel MCQ Quiz & Test
1) The _______ directory contains your project’s cache, session and log data.
2) Laravel is based on _____________________
3) Which one Laravel command line interface?
4) Which of following command is used to remove the compiled class file in Laravel?
5) How to define an mutator in Laravel?
6) Does Laravel Support Caching?
7) Where do we need to set database connection in Laravel?
8) What would this touch() function do? $obj= User::find(1); $obj->touch();
9) Which command is used to start laravel server?
10) Which command is used to create a new project in Laravel?
11) Composer is a tool for ______ in PHP.
12) What is it Blade?
13) Where is routing file located in Laravel?
14) Which command is used to create migrations in Laravel?
15) The vendor directory contains ___.
16) Which of following Collection method returns all records from Laravel collection?
17) Which one of the follwing command is used to create middleware in Laravel?
18) How to remove a complied class file?
19) What do you mean by dd() function?
20) Which of the following function in Laravel checks that the desired table is exists in the database or not?
21) Which class is used in Laravel to handle exceptions?
22) Which method is used in Laravel to method to check request is ajax or not?
23) Laravel is written in __ language.
24) Query scope is a feature of Laravel where we can ____.
25) In which directory controllers are kept in Laravel?
26) How to get current environment in Laravel?
27) In Laravel, @yield used for?
28) After running "artisan down", The project will show the maintenance page. What would be HTTP Status return Code?
29) Which directory contains “robot.txt” file ?
30) How to get current route name?
31) What is the minimum PHP version required to install Laravel 5.3?
32) How to get current action name in Laravel?
33) What is the latest version of Laravel?er 2020.
34) When was Laravel first released?
35) What does ORM stands for in laravel?
36) How to check current laravel version install your system?
37) Controller is create in laravel by using ____ command.
38) How to set a session data in Laravel?
39) Interpolation of variable in laravel is done using ___.
40) Which of the following methods are used in Database Migrations classes?
41) Which of the following is a root directory in laravel
Laravel Online Test Questions (Laravel FAQs)
1) How to initialize laravel collection?
A collection in Laravel Framework can be created from an array using the collect() helper method or by instantiating the Illuminate\Support\Collection class.
Below is an example to intialize Collection in Laravel
$collection = collect(['abc', 'Xyz', 'laravel']);
2) Explain relationships in Laravel Framework?
A relationship is an association between two models. Relationships are created to link tables together and provide a way for data to be related. In Laravel, there are mainly 3 types of relationships used in Laravel framework.
- belongs-to: The belongs-to relationship is the most common type of relationship that you will see in your application. It indicates that one model (belongs to) another model and it is often used to indicate that a user has many posts or a post belongs to a user.
- has-one: The has-one relationship indicates that one model (has one) belongs to another model but it does not have any additional information about the association between the two models such as how many there are or what type they are. It's often used when we want to show how many comments a post has or how many likes it received.
- has-many: The has-many relationship indicates that one model (has many) belongs to another model but it also provides
3) What is logging in Laravel?
The Laravel logging system is based on "channels". Each channel represents a specific way of writing log information, such as a console, file, or database. For example, you can create a channel called "console" that will write log information to the console. You can also create channels called "file" and "database" that will write log information to files and databases.
There are four main types of channels: -
- Event: A log event.
- Warning: A log warning.
- Error: A log error.
- Information: A log informational message.
4) What are Requests in Laravel?
Requests in Laravel are a way to send data to your application. There are two types of requests, GET and POST. GET requests are used when you want to retrieve data from the server and POST requests are used when you want the server to do something for you.
Requests are the first step in a Laravel workflow. It is the first thing that happens when a user interacts with your application.
Requests are made up of three parts:
- URL: The URL to which you want to redirect the user.
- HTTP: The HTTP verb you want to use (GET, POST, PUT, DELETE).
- DATA: The data you want sent with that request (parameters).
5) What is throttling and how to implement it in Laravel?
Throttling is a technique used to control the number of concurrent requests. It can be implemented in Laravel by using the throttle middleware.
Throttling is a technique used to limit the number of concurrent requests that can be processed by a system. It can be used for both limiting the load on your servers as well as for protecting against Denial-of-Service attacks. Throttling is often done with an API call or web request, but it can also be done via a queue, such as Beanstalkd or Gearman.
In Laravel, throttling can be implemented using the throttle middleware which will allow you to specify how many requests should go out per second and how long each request should wait before being sent out again.