php Archives | Codeexecute

What is web framework

Web framework (WF) also know as Web application framework (WAF)  is a framework that designed to support web applications. This will include we api, services and resources.The main aim of this architecture is re usability of code


Single Page Application vs Multi Page Application (SPA vs MPA)

In the era of cloud , every application has been / being migrated from desktop to web server. And companies  earlier having their older softwares on systems are creating the same  as web app for easy and global approach of clients. Now the webapp could be categorized into two types – One is traditional Multi Page Application and the other one is the latest and new approach as Single Page Application.What are SPA or MPA? Let’s figure out.

SPA (Single Page Application):

The latset approach towards creating the web app is Single Page application where all of the content from the server is rendered on single page html. It means:

  1. The routing is maintained on client side through Java Script
  2. Devlopement is easy and no need to learn different templating language for a front end devloper to develop the web pages like PHP, JSP or django templating
  3. Required data on page is served through JSON API from server not using context variables
  4. Switching into multiple URLs in the web page is easier and faster since routing is on clinet side
  5. Since all static content like CSS/JS has been loaded initially so redundancy of static variables minimizes the server load
  6. Using the same API the mobile application can be simultaneously build reducing the load of back end devloper.In this way a back end devloper can concentrate over business logic and code optimzation instead working on page rendering stuff of fron end.
  7. The devlopement would be fast as the front end and mobile developer can build their application using dummy api’s and later integrating them.

Example of SPAs : gmail, Facebook, Twitter

Multi Page Application(MPA)

The web app consists of multiple pages and all of these are rendered on server side.

  1. Rourting is maintained on server side
  2. Web app speed is slow as each routing requires a call towards server whihc may take additional round trip towrads server.
  3. SEO is better managed in MPA
  4. Backend devloper need to create mobile APIs to give JSON data to mobile devlopers(redundancy of logic).
  5. Tightly coupled front end /backend

As per the given approach it seems to be use SPA for a better user experience and fast devlopment process.

However the SPA also having their own cons. At the end the approch completely depends upon what is the business need.

So take a call and analyze which should be best for you..


What is composer

Composer is a dependency manager tool for PHP.It will manage all kind of dependencies that you require for a project. It will get all the required libraries and manage them all in one place.

Composer is not package manage but it’s manage libraries and manage(install/update) for us


What is robots.txt

Robots.txt is text file created by webmasters to instruct web robots how to crawl pages of their website. This file placed at the root of the site that indicates those parts of your site you don’t want accessed by search engine crawlers. The file uses the RES ( Robots Exclusion Standard ) protocol.

Default Format

User-agent : [agent-name]
Disallow   : [string not to be crawled]

Install Laravel Latest Version with Composer

Laravel is open source and most popular PHP frameworks for rapid web applications development. laravel provides great features like authentication techniques , Artisan , Routing , Eloquent ORM, Query Builder , Blade Templating , Security and many other features thats why its the most popular PHP framework among developers.

In this tutorial we will learn How to install Laravel latest version with composer. so keep follow the below steps .


We need composer to install laravel. If you have already installed composer then skip this step and if you want to install composer then click here and follow steps.

After the composer installation, run the following command to install laravel installer.

composer global require laravel/installer

after this command to scaffold a new application run the following command

laravel new myproject

Alternatively you can also create a new project using create-project command. to create a new application through create-project , run the following command :-

composer create-project --prefer-dist laravel/laravel myproject

Our new laravel project is created and to start the server, run the following command

php artisan serve

this command will start server at You can navigate to or if you installed laravel into xampp then you can also navigate to http://localhost/YourProjectName/myproject/public :).