From 7790c83208ac98fd15e6bf042b2ef881d61dc381 Mon Sep 17 00:00:00 2001 From: ell Date: Tue, 20 Dec 2016 13:09:17 +0300 Subject: [PATCH 1/3] Add nullable morph columns --- src/Illuminate/Database/Schema/Blueprint.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index e6c5c54343b2..369307d07c5c 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -901,6 +901,22 @@ public function morphs($name, $indexName = null) $this->index(["{$name}_id", "{$name}_type"], $indexName); } + /** + * Add nullable proper columns for a polymorphic table. + * + * @param string $name + * @param string|null $indexName + * @return void + */ + public function nullableMorphs($name, $indexName = null) + { + $this->unsignedInteger("{$name}_id")->nullable(); + + $this->string("{$name}_type")->nullable(); + + $this->index(["{$name}_id", "{$name}_type"], $indexName); + } + /** * Adds the `remember_token` column to the table. * From ec9a49dadf6a36a7f3a03e0307e5f9e4e1f2d727 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 20 Dec 2016 07:41:32 -0600 Subject: [PATCH 2/3] fix wording --- src/Illuminate/Database/Schema/Blueprint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index 369307d07c5c..a20fd190da9e 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -902,7 +902,7 @@ public function morphs($name, $indexName = null) } /** - * Add nullable proper columns for a polymorphic table. + * Add nullable columns for a polymorphic table. * * @param string $name * @param string|null $indexName From d744b01d363b4929a1ce18d47db09abaa132b5e4 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Tue, 20 Dec 2016 13:48:19 +0000 Subject: [PATCH 3/3] [5.3] Fixed broken event interface listening (#16877) * Fixed broken event interface listening * Fixed typos * Use the correct variable --- src/Illuminate/Events/Dispatcher.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Events/Dispatcher.php b/src/Illuminate/Events/Dispatcher.php index ede7ebe64017..31bacfef45f7 100755 --- a/src/Illuminate/Events/Dispatcher.php +++ b/src/Illuminate/Events/Dispatcher.php @@ -305,10 +305,16 @@ protected function sortListeners($eventName) $listeners = isset($this->listeners[$eventName]) ? $this->listeners[$eventName] : []; - if (class_exists($eventName, false)) { + if (class_exists($eventName)) { foreach (class_implements($eventName) as $interface) { if (isset($this->listeners[$interface])) { - $listeners = array_merge_recursive($listeners, $this->listeners[$interface]); + foreach ($this->listeners[$interface] as $priority => $names) { + if (isset($listeners[$priority])) { + $listeners[$priority] = array_merge($listeners[$priority], $names); + } else { + $listeners[$priority] = $names; + } + } } } }