Covid19 Support →   Enter the coupon code 20off on checkout!

How to setup the Laravel project cloned from Github

By Sal

So you’ve cloned a Laravel project off Github.com. But how can you actually run the existing Laravel project on your local?

Following the quick steps below you will get your project started. The tutorial assumes you already have a PHP, MYSQL local server, like EasyPhp. Ready?

  1. Create a database (remember the database name, username, password for step 3).

  2. From the project directory, type in your terminal:

    composer install
    
    cp .env.example .env
    
    php artisan key:generate
    
  3. Open .env and set database (database, username, password)

  4. In order to avoid the error Specified key was too long:

    • Open Providers/AppServiceProvider.php and paste the line below (right after use Illuminate\Suppoer\ServiceProvider; ):

      use Illuminate\Support\Facades\Schema;
      
    • Scroll down a bit, right inside public function boot() {}, paste:

      Schema::defaultStringLength(191);
      
  5. Now from your terminal:

    php artisan migrate
    
    php artisan db:seed
    
    php artisan serve
    

You should see something like:

“Laravel development server started: http://127.0.0.1:8000.

Visit that link to see your project live.

That’s it. You’ve made it!

Share