From ef7e412b1496054bb975d605c77fc4239a504fbc Mon Sep 17 00:00:00 2001 From: David Kirschman Date: Fri, 16 Mar 2018 15:59:58 -0600 Subject: [PATCH 1/2] Fix morphTo to correspond to Laravel 5.6 Laravel 5.6 breaks the morphTo function as it no longer fits the definition in Laravel. This is necessary in order to continue to use this package with Laravel 5.6. --- src/Ardent/Ardent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ardent/Ardent.php b/src/Ardent/Ardent.php index ba64236..de22fd9 100755 --- a/src/Ardent/Ardent.php +++ b/src/Ardent/Ardent.php @@ -448,7 +448,7 @@ public function belongsTo($related, $foreignKey = NULL, $otherKey = NULL, $relat * @param string $id * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function morphTo($name = null, $type = null, $id = null) { + public function morphTo($name = null, $type = null, $id = null, $ownerKey) { // If no name is provided, we will use the backtrace to get the function name // since that is most likely the name of the polymorphic interface. We can // use that to get both the class and foreign key that will be utilized. From 980c83b44425f4cb289263a5ca271c659d61cc88 Mon Sep 17 00:00:00 2001 From: David Kirschman Date: Fri, 16 Mar 2018 16:07:49 -0600 Subject: [PATCH 2/2] Make $ownerKey nullable. --- src/Ardent/Ardent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ardent/Ardent.php b/src/Ardent/Ardent.php index de22fd9..e76775f 100755 --- a/src/Ardent/Ardent.php +++ b/src/Ardent/Ardent.php @@ -448,7 +448,7 @@ public function belongsTo($related, $foreignKey = NULL, $otherKey = NULL, $relat * @param string $id * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function morphTo($name = null, $type = null, $id = null, $ownerKey) { + public function morphTo($name = null, $type = null, $id = null, $ownerKey = null) { // If no name is provided, we will use the backtrace to get the function name // since that is most likely the name of the polymorphic interface. We can // use that to get both the class and foreign key that will be utilized.