Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create and Edit Database Schema's with Laravel's new Illuminate libraries.
require 'vendor/autoload.php';
//require 'SplClassLoader.php';
//$classLoader = new SplClassLoader();
// Must manually include these :(
require 'Illuminate/Support/helpers.php';
* Uses laravel schema builder to produce schema's for us!
$grammar = new Illuminate\Database\Schema\Grammars\SQLiteGrammar;
//$grammar = new Illuminate\Database\Schema\Grammars\MySqlGrammar;
$table = new \Illuminate\Database\Schema\Blueprint('users');
$table->string('email', 100)->nullable()->default('bar');
// created_at, updated_at
$table->index(array('foo', 'bar'), 'baz');
$statements = $table->toSql($grammar);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.