PHP Frameworks

PHP Frameworks: Frameworks help developers to create applications rapidly and robust applications. Here you can read interview questions on Popular PHP Frameworks like Laravel, CakePHP, CodeIgniter, Phalcon and many more

  • What are pros and cons of using Laravel Framework?

    Posted By: Bharathi

    Pros of Laravel

    1. It uses Blade template engine that helps in speed up compilation tasks and writing cleaner code.
    2. Bundled modularity forces code reusability.
    3. Easy to understand Eloquent ORM.
    4. Outstanding Command Line Interface Artisan.
    5. Clean, clear easily understandable documentation.

    Cons of Laravel

    1. Quite slow because of loading multiple vendors.
    2. Amature developers face some difficulties in staring, but once they are familiar it will be fun to code in Laravel.
    3. Community support is not as wide as a comparison to other frameworks.
    4. Upgrading framework is a headache.

  • What is Laravel service container?

    Posted By: Addison

    Service Container in Laravel is a Dependency Injection Container and a Registry for the application. It is one of the most powerful tool for managing class dependencies and performing dependency injection.

  • How To Use Delete Query In Laravel ?

    Posted By: Titus


    is the simplest way to delete a record in Laravel.

  • How To Use Update Query In Laravel ?

    Posted By: Edie

    Updating a record in Laravel using Eloquent.


  • What is Laravel Dusk?

    Posted By: Gabe

    Laravel Dusk is browser automation and testing tool introduced in Laravel 5.4. It uses ChromeDriver to perform browser automation testing.

  • What is Laravel Echo?

    Posted By: Firman

    Laravel Echo is a tool that makes it easy for you to bring the power of WebSockets to your Laravel applications. It simplifies some of the more common—and more complex—aspects of building complex WebSockets interactions.

    Echo comes in two parts: a series of improvements to Laravel's Event broadcasting system, and a new JavaScript package.


  • What is Laravel Homestead ?

    Posted By: Robin

    Laravel Homestead is an official, pre-packaged Vagrant "box" that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine.

  • What is Tagging?

    Posted By: Esta

    Tagging is a package in Laravel that allow you to tag your content like pages/ post to a keyword.

  • What is dependency injection in Laravel ?

    Posted By: Leander

    Dependency injection or (D.I) is a technique in software Engineering whereby one object (or static method) supplies the dependencies of another object. A dependency is an object that can be used (a service). Injection is the passing of dependency to a dependent object (a client) that would use it.

    Basically, You can found 3 types of dependency injection:

    • Constructor injection
    • Setter injection
    • Interface injection

  • What are named routes in Laravel?

    Posted By: Vernie

    Named routing is another amazing feature of the Laravel framework. Named routes allow referring to routes when generating redirects or URLs more comfortably. You can specify named routes by chaining the name method onto the route definition:


    Route::get('user/profile', function () {

    You can specify route names for controller actions:

    Route::get('user/profile', 'UserController@showProfile')->name('profile');

    Once you have assigned a name to your routes, you may use the route's name when generating URLs or redirects via the global route function:

    // Generating URLs...
    $url = route('profile');
    // Generating Redirects...
    return redirect()->route('profile');


  • What are Laravel eloquent?

    Posted By: Hershel

    Eloquent is an ORM in Laravel that implements active record pattern and is used to interact with relational databases.

  • What is a Facade?

    Posted By: Thad

    In Programming, Facade is a software design pattern which is often used in object-oriented programming. Laravel facade is a class which provides a static-like interface to services inside the container.

  • How To Use Delete Statement In Laravel?

    Posted By: Loren

    Use delete statement in Laravel:

    In Query Builder Way:

    \DB::table('users')->delete($id); // delete with id
    \DB::table('users')->where('name', $name)->delete(); \\ delete with where condition

    In Eloquent Way:

     User::find($id)->delete() // delete with id
     User::where(['name'=>$name])->delete();  \\ delete with where condition

  • What is an Observer in Laravel?

    Posted By: Tommy

    An observer attaches to an Eloquent Model for Laravel.

    This observer can listen to many different events that happen on the model such as: creating, created, saving, saved, deleting, deleted and many more... All of which you can find here:

    The observer listens for these events and fires whenever said action is triggered, letting you preform pre or post procedure statements whenever an action is taken.

     For instance, if you have a user registration page, and every time you create a user, you want to ensure that the password is hashed... You can hook into the User "creating" event.

     public function creating(User $user) {
      $user->password = bcrypt($user->password);


     This will ensure that every time a user is created with a password, that password is automatically hashed.

     In order to register the Observer, you should place it in either the boot() section of your AppServiceProvider or your own custom provider. Note: if you use a custom provider, be sure to register it in config/app.php

    You will need the model and the observer. IE:


    boot() {
       User::observe(new UserObserver);

    // That's it...


    Now any events that the User model fires will be performed by the User Observer if you have identified any in the observer.

  • How to get current Url in Laravel ?

    Posted By: Andreasdli

    In Laravel 5.5 or above you can use url()->current(); to get current URL without query string and  url()->full(); with the query string.

  • How To Use Select Query In Laravel?

    Posted By: Doctor


    This will create a collection that only contains the 'name' property of ever user...


    This will select name and username from users

  • Which template engine Laravel use ?

    Posted By: Webki Mad

    Laravel uses Blade template Engine.

  • How to use custom table in Laravel Model ?

    Posted By: Martha

    protected $table = 'custom_table_name';

    Attach this to your CustomModel.php



  • What are Closures in laravel ?

    Posted By: Oscar

    A Closure is an anonymous function that often used as callback methods and can be used as a parameter in a function.

    Example of Laravel Closure

    User::with('profile', function ($builder) {
    	// Get me all collapsed comments
    	return $builder->whereCollapsed(true);

  • How to get Logged in user info in Laravel ?

    Posted By: Cora

  • Does laravel support php 7?

    Posted By: Najim Mulla

    Yes, Laravel supports PHP 7.

  • What is Laravel Elixir ?

    Posted By: kristen gorge

    Laravel Elixir provides a clean, fluent API for defining basic Gulp tasks for your Laravel application. Elixir supports several common CSS and JavaScript pre-processors, and even testing tools. Using method chaining, Elixir allows you to fluently define your asset pipeline.

    Laravel Elixir Example

    elixir(function(mix) {

  • What is the latest version of laravel?

    Posted By: Franklin

  • How can you display HTML with Blade in laravel

    Posted By: Bessie

  • How to install laravel via composer ?Syntax

    Posted By: Irwin

  • What are Cookies ? How to get , set , distroy cookies in Laravel ?

    Posted By: Clifton

  • How can you Exclude URIs From CSRF Protection in Laravel ?

    Posted By: Cecil

  • What getFacadeAccessor method does

    Posted By: Dell

  • How to get current URL in CakePHP ?

    Posted By: Kausalya

    Getting current URL in CakePHP In CakePHP View

    <?php echo $this->here; ?>

    In Controller

    	<?php echo Router::url( $this->here, true ); ?> 

  • List some features of CakePHP framework ?

    Posted By: Alcee

     Some features of CakePHP Frameworks are -

    •   Model Veiw Controller Pattern
    •   Object Relational Mapping
    •   Class inheritance
    •   No Configuration
    •   CRUD Scaffolding
    •   Built in Validation
    •   Easily extends with Plug-ins

  • What is MVC in CakePHP ?

    Posted By: Lafayette

    Model View Controller (MVC) - targets the modern programming needs. CakePHP uses it just right with all the entities working together excellently and providing a great way to work on different aspects of development in a vitally planned system of data processing. 

    Model layer represents the logical part of our Application.It retrieves the data and convert it into meaningful concepts.

    Veiw layer shows the output to the end user.It process the input provided by the Model Layer and generates specific out put to the end user.

    Controller Layer is responsible for handling all requests coming from all users. It Collects the input from users and coordinate for the model and veiw codes.



  • How to write, read and delete the Session in cakephp?

    Posted By: Haywood

    Reading session in cakePHP -


    Deleting session in cakePHP -


  • What is symfony? List some features?

    Posted By: BorisIncive

  • What are symfony bundles?

    Posted By: Theodore

  • what are components in symfony?

    Posted By: Levy

  • Does laravel use symfony?

    Posted By: Sterling

  • Symfony logs are stored in which directory?

    Posted By: Hoyt

  • How to clear cache in Symfony?

    Posted By: Anamika Kumari

  • how to create a bundle in Symfony?

    Posted By: Authur

  • what are annotations in Symfony?

    Posted By: Elonzo

  • How to create an remove session in Symfony Framework?

    Posted By: Bascom

  • Explain What is FuelPHP?
    Fuel Php

    Posted By: Milo

  • What HMVC is Framework?
    Fuel Php

    Posted By: Herbertbot

  • List some advantages of FuelPHP?
    Fuel Php

    Posted By: Shivprasad

  • What is Presenter in FuelPHP?
    Fuel Php

    Posted By: Ed

  • List out the reserved routes in FuelPHP?
    Fuel Php

    Posted By: Eliseo

  • What is offical website of FulePHP?
    Fuel Php

    Posted By: David

  • List few benefits of HMVC?
    Fuel Php

    Posted By: Nomaan

  • How to get Query in FulePHP?
    Fuel Php

    Posted By: admin

  • What is Scaffolding in FuelPHP?
    Fuel Php

    Posted By: Pleas

  • What are the minimum server requirement to install Fuelphp?
    Fuel Php

    Posted By: jai

  • What is Lumen?

    Posted By: Orla

    Lumen is micro-framework by Laravel. It is developed by the creator of Laravel Taylor Otwell for creating smart and blazing fast API’s. Lumen is built on top components of Laravel. As Lumen is a micro-framework not a complete web framework like Laravel and used for creating API’s only, so most of the components as HTTP sessions, cookies, and templating are excluded from Lumen and only features like routing, logging, caching, queues, validation, error handling, database abstraction, controllers, middleware, dependency injection, Blade templating, command scheduler, the service container, and the Eloquent ORM are kept.

  • Difference between Contracts and Facades?

    Posted By: Freeman

    Contracts are an interface, while Facades are not an interface. it is a class. 

    Contracts are a set of interfaces that define the core services provided by the framework, while Facades provide a static interface to classes that are available in the application's service container.


  • How to set csrf token in codeigniter?

    Posted By: Guy

    CSRF stands for Cross-Site Request Forgery. It is an attack that forces an end user to execute unwanted actions on a web application in which they're currently authenticated.

    Adding a CSRF token in your forms is a way to prevent your website by CSRF Attack.

    CSRF in CodeIgniter:

    First, we have to enable CSRF in Config file by adding

    $config['csrf_regenerate'] = TRUE;

    To add CSRF token in Custom Form

       $csrf = array(
        'name' => $this->security->get_csrf_token_name(),
        'hash' => $this->security->get_csrf_hash()
         <input name="<?=$csrf['name'];?>" value="<?=$csrf['hash'];?>" type="hidden" />

    If you are creating your form using CodeIgniter helper then it will be enabled By default.

  • What is CakePHP?

    Posted By: Najim Mulla

    CakePHP is rapid development framework for PHP like Laravel it also flows MVC Design Pattern. It completly written in PHP and modeled after the concepts of Ruby on Rails. It is free use and and distributed under the MIT License.

    Some facts About CakePHP
    Distributed UnderMIT License
    First Released OnApril 2005
    Current Stable Version3.7.8
    Written InPHP

  • Enlist few key features of Silex Framework?
    Silex Framework

    Posted By: Vernon

  • Explain middleware in Silex?
    Silex Framework

    Posted By: Emil

  • How to install csrf in Silex?
    Silex Framework

    Posted By: Llewellyn

  • Explain what is Phalcon?

    Posted By: Percival

    Phalcon is a loosely coupled PHP framework which is based on MVC (Model-View-Controller) architecture and delivered as C extension.

  • What is lazy initialization in Phalcon?

    Posted By: Francis

  • What is MVC in Phalcon?

    Posted By: sandeep chegu

  • Explain PHQL In Phalcon?

    Posted By: Anonymous

  • What is ODM in Phalcon?

    Posted By: Verner

  • Enlist few features of Phalcon Framework?

    Posted By: Richard

  • Phalcon is written in which Language?

    Posted By: Bill

  • What is zephir in Phalcon?

    Posted By: Page

  • Explain dependency injection in Phalcon?

    Posted By: Anderson

  • Which template engine is used in Phalcon?

    Posted By: Early

  • List some database related functions available in Phalcon?

    Posted By: Augustus

  • How can you inject Services into a Volt Template?

    Posted By: Ivan

  • How to increase CSRF timeout in Phalcon?

    Posted By: Mrudula

  • List Database engines supported by Phalcon?

    Posted By: Rupert

  • How to pass data from the controller to view in Phalcon?

    Posted By: Orie

  • Explain Routing in Phalcon?

    Posted By: Everett

  • What are Single or Multi-Module Applications in Phalcon?

    Posted By: Bedford

  • Enlist various types of application events available in Phalcon?

    Posted By: waqas

  • How many type of views are avilable in Phalcon?

    Posted By: Newman

  • What is Slim framework?
    Slim Framework

    Posted By: Nels

  • How would you define a middleware in Slim?
    Slim Framework

    Posted By: Edmond

  • How can you install Slim Framework v2?
    Slim Framework

    Posted By: Olin

  • What kind of applications you create in slim Framework.
    Slim Framework

    Posted By: Vikram Patil

  • Is Slim is better than Silex?
    Slim Framework

    Posted By: R S RUSSELL

  • Who is the creater of Slim?
    Slim Framework

    Posted By: Percival

  • How can you configure Slim with Doctrine?
    Slim Framework

    Posted By: kristen gorge

  • How to set charset for DB in slim framework?
    Slim Framework

    Posted By: Suresh

  • How can you set and get a cookie in Slim Framework?
    Slim Framework

    Posted By: Tyler

  • How to define route groups in Slim Framework?
    Slim Framework

    Posted By: Budd

  • Enlist some Environment Variables available in Slim Framework?
    Slim Framework

    Posted By: Calvin

  • What is a hook in Slim Framework?
    Slim Framework

    Posted By: Otto

  • How to enable CORS in Slim Framework?
    Slim Framework

    Posted By: Gabriel

  • How to get remote IP address in Slim Framework?
    Slim Framework

    Posted By: Jessee

  • Enlist the Request Method available in Slim Framework?
    Slim Framework

    Posted By: Ethan

  • What is Yii2?
    Yii 2

    Posted By: Willam

  • What are the prerequisites to install Yii2 Framework?
    Yii 2

    Posted By: Isaac

  • List few benifits of Yii over other PHP Frameworks?
    Yii 2

    Posted By: Roshan Kumar

  • Enlist few major features of Yii Framework?
    Yii 2

    Posted By: Dipali Sharma

  • Explain request Life Cycle in Yii2 framework?
    Yii 2

    Posted By: Bhagyashri

  • What is the difference between YII & YII2?
    Yii 2

    Posted By: Marshall

  • What is Active Record(AR) in Yii?
    Yii 2

    Posted By: Auguste

  • What are Yii helpers?
    Yii 2

    Posted By: Colonel