From 67696d81148099ef32738e7ec16db6883c1bc4f0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Jan 2012 08:43:12 -0600 Subject: [PATCH] index names may be specified on fluent setup. --- laravel/bundle.php | 4 ++-- laravel/database/schema.php | 5 +++-- laravel/fluent.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/laravel/bundle.php b/laravel/bundle.php index 8fb05014..20c7bb6a 100644 --- a/laravel/bundle.php +++ b/laravel/bundle.php @@ -40,8 +40,6 @@ public static function start($bundle) throw new \Exception("Bundle [$bundle] has not been installed."); } - static::$started[] = strtolower($bundle); - // Each bundle may have a "start" script which is responsible for preparing // the bundle for use by the application. The start script may register any // classes the bundle uses with the auto-loader, or perhaps will start any @@ -55,6 +53,8 @@ public static function start($bundle) // registering the bundle's routes. This is kept separate from the // start script for reverse routing efficiency purposes. static::routes($bundle); + + static::$started[] = strtolower($bundle); } /** diff --git a/laravel/database/schema.php b/laravel/database/schema.php index 84de3eb0..0c3ecef8 100644 --- a/laravel/database/schema.php +++ b/laravel/database/schema.php @@ -29,6 +29,7 @@ public static function table($table, $callback) */ public static function execute($table) { + die('here'); foreach ($table->commands as $command) { $connection = DB::connection($table->connection); @@ -82,9 +83,9 @@ protected static function implications($table) { foreach (array('primary', 'unique', 'fulltext', 'index') as $key) { - if ($column->$key === true) + if (isset($column->attributes[$key])) { - $table->$key($column->name); + $table->$key($column->name, $column->$key); } } } diff --git a/laravel/fluent.php b/laravel/fluent.php index 255ecc75..fbfaf57a 100644 --- a/laravel/fluent.php +++ b/laravel/fluent.php @@ -7,7 +7,7 @@ class Fluent { * * @var array */ - protected $attributes = array(); + public $attributes = array(); /** * Create a new fluent container instance.