From f27027d3a85775b596cd82a8241346c0ab0909ad Mon Sep 17 00:00:00 2001 From: Phill Sparks Date: Thu, 22 Mar 2012 14:27:04 +0000 Subject: [PATCH 1/2] Added __isset and __unset to Fluent Signed-off-by: Phill Sparks --- laravel/fluent.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/laravel/fluent.php b/laravel/fluent.php index 1c83b468..58c70207 100644 --- a/laravel/fluent.php +++ b/laravel/fluent.php @@ -77,4 +77,20 @@ class Fluent { $this->attributes[$key] = $value; } + /** + * Dynamically check if an attribute is set. + */ + public function __isset($key) + { + return isset($this->attributes[$key]); + } + + /** + * Dynamically unset an attribute. + */ + public function __unset($key) + { + return unset($this->attributes[$key]); + } + } \ No newline at end of file From d1de7b9ffe0ed6f8f15e13c536ec611367c60e1a Mon Sep 17 00:00:00 2001 From: Phill Sparks Date: Thu, 22 Mar 2012 14:27:37 +0000 Subject: [PATCH 2/2] Fix named keys on Schema columns. Signed-off-by: Phill Sparks --- laravel/database/schema.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/laravel/database/schema.php b/laravel/database/schema.php index 2337a27d..3787e33b 100644 --- a/laravel/database/schema.php +++ b/laravel/database/schema.php @@ -120,9 +120,16 @@ class Schema { { foreach (array('primary', 'unique', 'fulltext', 'index') as $key) { - if (isset($column->attributes[$key])) + if (isset($column->$key)) { - $table->$key($column->name); + if ($column->$key === true) + { + $table->$key($column->name); + } + else + { + $table->$key($column->name, $column->$key); + } } } }