Top 10 Laravel Interview Questions And Answers

Nov 11, 2019 Eduardo Zambrano

What is Laravel?

  • Laravel is a PHP framework used to develop web applications. 
  • Laravel is a framework with elegant and expressive syntax.
  • Laravel is based on MVC design pattern
  • It is created by Taylor Otwell.
  • It helps in creating wonderful web applications easily and quickly

What are the main features of Laravel over other Frameworks?

  • Modularity
  • Authentication
  • Application Logic
  • Cache
  • Routing
  • Automatic pagination
  • Template Engine
  • Database Query Builder
  • Eloquent ORM  

What are the different artisan commands in Laravel?

  • PHP artisan list
  • PHP artisan help
  • PHP artisan tinker
  • PHP artisan make
  • PHP artisan –version(Get Current version of Laravel)
  • PHP artisan make model model_name
  • PHP artisan make controller controller_name 

What happens when you type 'PHP artisan' command?

  • It lists dozens of artisan commands

What is the template engine that Laravel will use?

  • Blade template

What are active records?

  • Active Record is an architectural pattern found in software engineering
  • Active Records store memory object data in relational databases.
  • Example:
    $product = new Product;
    $product->name = 'Windows Os';
  • In this example mapping the Product object to a row product table of database.

What are the different relations in Laravel?

  • One To One
  • One To Many
  • One To Many (Inverse)
  • Many To Many
  • Has Many Through
  • Polymorphic Relations
  • Many To Many Polymorphic Relations 

What is Lumen?

  • Lumen is a microframework developed by Laravel.
  • It is used for creating API's only
  • Lumen is one of the smallest framework and faster than Laravel
  • Some of the configurations done in Laravel are predefined in Lumen.

What is a composer?

  • Its a dependency manager used for installing dependencies of PHP applications.  
  • Composer Install or update libraries.

What are the Laravel Events?

  • An event is an incident or occurrence detected and handled by the program.
  • Example:
    • A new user has registered.
    • A new comment is posted
    • User login/logout
    • A new product is added.