Tuesday, April 18, 2017

Laravel Interview Questions and Answers

01.   Why is Laravel so popular?
Advantage,s of Laravel
·         Easy and consistent syntax 
·         Set-up process is easy
·         Customization process is easy
·         Code is always regimented with Laravel  
·         Bundles
·         Query Builder
·         Reverse Routing
·         IOC Container feature
·         Database Seeding
·         Automatic pagination
For what laravel is so popular


02.   What is the purpose of using dd() function?
Laravel dd() helper function, which will dump a variable’s contents to the browser and halt further script execution.

03.   Write the function of Tinker Console.
Creating and executing a PHP script for each purpose is kind of tedious. We eliminate the additional overhead by using the tinker console, a command line based window into our laravel application.

04.   What is Restful Controller?
Each application controller for managing the associated resource. For instance, a controller named Lists Controller might be responsible for retrieving all lists, retrieving a lists detail view .inserting a new list. Modifying an existing and deleting a list. This type of controller is called Restful controller.

05.   What is Blade?
Laravel template engine is called Blade. The blade is the simple, yet powerful templating engine provided with Laravel, Unlike other popular PHP template engines.

06.   Write the advantage of using view partially.
Include a recurring widget within several different areas of the application.
to manage widget within a separate file.

07.   What is Laravel Elixir?
The larvae developers hope to reduce some of the time and annoy connected with sort everyday jobs by providing that a new API called laravel Elixir.
Laravel Elixir provides a clean, smooth API for our Laravel define fundamental Alcoholism for Relevance.

08.   How many databases are supported by Laravel?
Laravel supports four databases, including MySQL, PostgreSQL, SQLite, and Microsoft SQL Server

09.   What is ORM?
Object-relational mapping (ORM) is a program structure that allows us to describe a mapping between application object model and the relational database.


10.   Write the benefits of using Migrations
With the model created, we will typically create the corresponding database table, through a fantastic laravel feature known as migrations.
1. Allowing creating and dropping database
2. Update and delete columns
3. Add index

11.   What is the purpose of database seeding?
With database seeding w,e can fill our database with dummy data with a simple command. laravel  seeding feature to easily insert even large amounts of data into our database. We can seed a database


12.   What is Query Builder?
Laravel's database query builder provides a suitable, easy interface to creating and organization database queries. It can be used to achieve most database operations in our application and works on all supported database systems.
The Laravel query planner uses PDO restriction necessary to keep our application against SQL injection attacks.

13.   Explain the use of slug gable URL.
Frameworks such as laravel do a great job of creating user friendly URLS by default, meaning the days of creating application sporting ugly URLs like below.
http//todoparrot.com/lists.php?id=12
Instead, laravel will transform a url like the above into something much more readable, such as
http//todoparrot.com/lists/12
http//todoparrot.com/lists/san-juan-vacation->this string based parameter is known as a slug.

14.   Mention the name of relations which are supported by Laravel.
One To One
One To Many-> A "one-to-many" relationship is used to define relationships where a single model owns any amount of other models.
Many To Many
Has Many Through
Polymorphic Relations
Many To Many Polymorphic Relations

15.   What are scopes?
Applying conditions to queries gives us to power to retrieve and present filtered data in every imaginable manner. This condition of easily read and reusable statement

16.   What is Middleware?
Middleware provide a convenient mechanism for filtering HTTP requests entering our application. For example, Laravel includes a middleware that verifies the user of our application is authenticated. If the user is not genuine, the middleware will send the user to the login monitor. However, if the user is genuine, the middleware will permit the request to carry on additional into the application.

17.   Define two types of Middleware.
Before & After Middleware
For example, before middleware would perform some task before the request is handled by the application:
However, after middleware would perform its task after the request is handled by the application:

18.   Describe setting options of Laravel authentication.
The Config /auth.php file uses laravel’s authentications settings.
 A. driver: This setting determines how the will be retrieved and authenticated.
B. model: This setting tells laravel what model will be used to maintain the user information.
C. table: This setting identifies the database table used to store the user information.
D. password: This setting identifies, the database table used to manage password recovery requests.

19. What is a composer?
The PHP dependency manager is a composer to install PHP applications dependency.

20. What is PHP creation? List of some artisan commands?
PHP Artist is a tool included with command line interface / Laravel. It provides some helpful commands that can easily help you while building your application. Here is some list of artist commands: -
·         Php artisans list
·         Php artisans help
·         Php artisan tinker
·         PHP Manufacturer
·         Php Manufacturer - Wizards
·         Create Php artisan modal modal_name
·         Do the php artisan controller controller_name

21. Explain Laravel Events?
An event is identified by an event and programmed by the program. The Laravel event is available to implement a common observer, allow us to subscribe and hear the events of our applications. Below are examples of some events in Here well: -
·         A new user has been registered
·         A new comment is posted
·         User login / logout
·         New products are added.

22. List some addition methods provided by Query Builder at 24 Laravel
·         Counting ()
·         Max ()
·         Minutes ()
·         Average daily ()
·         Sum ()

3 comments:

  1. Looking for more interview questions on Laravel. Browse below link.
    http://www.laravelinterviewquestions.com/laravel-interview-questions-and-answers

    ReplyDelete
  2. Laravel is free open source "PHP framework" based on MVC design pattern.
    It is created by Taylor Otwell. Laravel provides expressive and elegant syntax that helps in creating a wonderful web application easily and quickly.
    Here we have written Top 30 Laravel Interview questions and their answers that is asked to developers
    in Laravel Interview in the year 2017.

    ReplyDelete

  3. Nice blog has been shared by you. it will be really helpful to many peoples who are all working under the technology.thank you for sharing this blog.
    Magento course in chennai

    ReplyDelete