Built in command line tool “Artisan” for creating a code skeleton ,database structure and build their migration.

5. What is composer ? Composer is PHP dependency manager used for installing dependencies of PHP applications.6. How to install laravel via composer ?

composer create-project laravel/laravel your-project-name version

7. How to check laravel current version ? You can check the current version of your Laravel installation using the –version option of artisan command Usages:-

php artisan --version

8. What is php artisan. List out some artisan command ? PHP artisan is the command line interface/tool included with Laravel. It provides a number of helpful commands that can help you while you build your application easily. Here are the list of some artisian command:-

php artisan list

php artisan help

php artisan tinker

php artisan make

php artisan –versian

php artisan make modal modal_name

php artisan make controller controller_name

9. Explain Events in laravel ? An event is an incident or occurrence detected and handled by the program.Laravel event provides a simple observer implementation,that allow us to subscribe and listen for events in our application. Below are some events examples in laravel :-

A new user has registered

A new comment is posted

User login/logout

New product is added.

10. How to enable query log in laravel? Use the enableQueryLog method:DB::connection()->enableQueryLog(); You can get array of the executed queries by using getQueryLog method:$queries = DB::getQueryLog();

11. How to turn off CRSF protection for a route in Laravel? In “app/Http/Middleware/VerifyCsrfToken.php” //add an array of Routes to skip CSRF check

12. What is Lumen? Lumen is PHP micro framework that built on Laravel’s top components. It is created by Taylor Otwell. It is perfect option for building Laravel based micro-services and fast REST API’s. It’s one of the fastest micro-frameworks available.

13. What are laravel facades? Laravel Facades provides a static like interface to classes that are available in the application’s service container. Laravel self ships with many facades which provide access to almost all features of Laravel’s . Laravel Facades serve as “static proxies” to underlying classes in the service container and provides benefits of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods of classes. All of Laravel’s facades are defined in the Illuminate\Support\Facades namespace. You can easily access a Facade like so:

14. What are laravel Contracts? Laravel’s Contracts are nothing but set of interfaces that define the core services provided by the Laravel framework. You can read about How to Laravel contracts by How to use Laravel facade .

15. Explain Laravel service container ? One of the most powerful feature of Laravel is its Service Container It is a powerful tool for resolving class dependencies and performing dependency injection in Laravel . Dependency injection is a fancy phrase that essentially means class dependencies are “injected” into the class via the constructor or, in some cases, “setter” methods. You can read more from here

Any packages we pulled from composer is kept in vendor directory of laravel.

20. In which directory controllers are located in Laravel ?We kept all controllers inapp/http/Controllers directory

21 .What does PHP compact function do ?

PHP compact function takes each key and tries to find a variable with that same name.If variable is found , them it builds an associative array.22. Define ORM ?

Object-relational Mapping (ORM) is a programming technique for converting data between incompatible type systems in object-oriented programming languages.23 .How to create a record in Laravel using eloquent? ?

To create a new record in the database using laravel Eloquent, simply create a new model instance, set attributes on the model, then call the save method: Here is sample Usage

25 .What is the purpose of the Eloquent cursor() method in laravel ? The cursor method allows you to iterate through your database records using a cursor, which will only execute a single query. When processing large amounts of data, the cursor method may be used to greatly reduce your memory usage. Example Usage