The Blog

"Information IS Key "

So, you want a SaaS application using Laravel 5.1?
(Pre Laravel 5.2)

PHP, Laravel, Spark

Spark is a starter kit for SaaS applications and is a fantastic idea by the man who created Laravel, Taylor Otwell.

Spark is in its infant stage and with it being in Alpha, at the time of this writing, has some quirks. I am going to go through the steps I took to start using Spark right away, when sparl install does not work.

This is an alpha, experimental release of Spark. Things will change. Things will break. Thank you for testing! Taylor Otwell Spark Github README.md

Assumptions are you have a good understanding of the following

  • Laravel 5.1
  • Laravel Installer
  • Spark
  • Homestead
  • Composer
  • Vagrant
  • npm
  • Gulp

Okay, lets get started!

Create a new project from you Virtual Machine

cd /path/to/vagrant
vagrant ssh
cd /path/to/your/project/folder
laravel new spark

Require Spark (not using the latest versions due to Laravel 5.2 requirements)

cd spark
composer require laravel/spark:0.2.1

Register the spark service provider in config/app.php

Laravel\Spark\Providers\SparkServiceProvider::class,

Install Spark

php artisan spark:install

Chances are you will need to add this file:

vendor/laravel/framework/Illuminate/Foundation/Auth/User.php

Contents of this file:

<?php

namespace Illuminate\Foundation\Auth;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;

class User extends Model implements
    AuthenticatableContract,
    AuthorizableContract,
    CanResetPasswordContract
{
    use Authenticatable, Authorizable, CanResetPassword;
}

From your local terminal, install packages for Laravel Elixir

cd /path/to/your/application/public
sudo npm install

From your local terminal, run Gulp for the first time

gulp

Conclusion

This is the method that worked in my situation, yours may be different! Enjoy!