9951 explained code solutions for 126 technologies


php-laravelHow do I use an online editor to create a Laravel application in PHP?


  1. To create a Laravel application in PHP using an online editor, first create a project directory on your local computer and open it in the editor.
  2. Create a new file called composer.json and add the following code:
{
    "require": {
        "laravel/framework": "4.2.*"
    }
}
  1. Run the command composer install to install the Laravel framework.
  2. Create a new file called index.php and add the following code:
<?php
require 'vendor/autoload.php';
$app = new Laravel\Lumen\Application();
$app->run();
  1. Run the command php -S localhost:8000 to start the application.
  2. Open a web browser and navigate to localhost:8000 to view the application.
  3. You can now use the online editor to create and modify the Laravel application.

Helpful links

Edit this code on GitHub