Basic Laravel Interview Questions and Answers



In this tutorial we are providing some set of frequently asked Basic Laravel Interview Questions. We have included most commonly asked entry level interview questions. Read PHP Interview Questions and Answers.

  1. What is Laravel?

    Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller architectural pattern and based on Symfony.

  2. What developed the Laravel?

    Taylor Otwell.

  3. When Laravel was launched?

    June 2011

  4. What is current stable version of Laravel?

    Version 5.6.12 / March 14, 2018

  5. In which programming language it was written?

    PHP.

  6. What is offical website URL of Laravel?

    laravel.com.

  7. Is Laravel an Open Source?

    Yes, download the framework and use as per your requirement

  8. How to install Laravel?

    We can install the Laravel in following ways.

    Via Laravel Installer
    Via Composer Create-Project

  9. What are the feature of Laravel5.0?

    New directory structure
    Method injection
    Contracts
    Route caching
    Authentication
    Events object
    Multiple file system
    Laravel Scheduler

  10. What are the system requirements for installation of Laravel 5.6 (latest version)?

    PHP >= 7.1.3
    OpenSSL PHP Extension
    PDO PHP Extension
    Mbstring PHP Extension
    Tokenizer PHP Extension
    XML PHP Extension
    Ctype PHP Extension
    JSON PHP Extension

  11. Where Libs are stored in Laravel?

    All libs and packages stored in vendor/ directory.

  12. What is ORM and which ORM are using By laravel?

    Object-relational Mapping (ORM) is a programming technique that help to converting data between incompatible type systems in object-oriented programming languages.The Eloquent ORM is using by Laravel.

  13. How to check Laravel Version?

    Using php artisan –version command to check current installed version of Laravel Framework.

  14. What is Events in Laravel?

    The event is an incident or occurrence which will detected and handled by the program.You can create event and and subscribe to listen that event, for example, You want to send an email when user has been registered, for this You will create an event and listen event using subscribe and sent email to user.

  15. What is CRSF protection and how to disabled?

    By default, CRSF(cross-site request forgery ) is on with laravel and resides in “app/Http/Middleware/VerifyCsrfToken.php”. The CRSF help to protect your website from malicious attacks. You can disabled CRSF by writing some code into VerifyCsrfToken.php file.

  16. Which template Engine Using By Laravel?

    Blade – the blade is a powerful templating engine.

  17. How to create Connection with Database?

    You can create db connection using .env file or using config/database.php file.

  18. What is Migration in Laravel?

    Migration is related to database operation like creating table,updating table etc. using PHP script, All the Migrations script is stored in /database/migrations folder. The migration file have timestamp that help to artisan identify order of migration script will execute.

  19. How do you register a Service Provider in Laravel?

    You can register service provider using bootstrap/app.php file.You need to add an entry of service provider into ‘providers’ array.

  20. How to Display SQL Query?

    You can logs and display query using below code.

    $queries = DB::getQueryLog(); 
    
  21. What are the main benefit of laravel over other php framework?

    Inbuilt Authentication System.
    Inbuilt blade template System.
    Eloquent ORM (Object Relation Mapping) with PHP active record implementation.
    Laravel had “Artisan” command line tool that help to create code skeleton, migration script, scheduling process etc.