From 0693d335ed1a3bfdf758cf4d75d7b167aa79f478 Mon Sep 17 00:00:00 2001 From: Sleeping Owl Date: Thu, 16 Oct 2014 14:41:52 +0400 Subject: [PATCH] Downgrade to PHP 5.4 support --- src/SleepingOwl/Admin/AdminServiceProvider.php | 5 ++--- .../Admin/Commands/Compilers/ModelCompiler.php | 14 +++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/SleepingOwl/Admin/AdminServiceProvider.php b/src/SleepingOwl/Admin/AdminServiceProvider.php index e37ced33..5c1c1727 100644 --- a/src/SleepingOwl/Admin/AdminServiceProvider.php +++ b/src/SleepingOwl/Admin/AdminServiceProvider.php @@ -1,7 +1,6 @@ registerCommands(); - $this->app->register(ImageServiceProvider::class); - $this->app->register(AdminAuthServiceProvider::class); + $this->app->register('\Intervention\Image\ImageServiceProvider'); + $this->app->register('\SleepingOwl\AdminAuth\AdminAuthServiceProvider'); $this->registerFormBuilder(); diff --git a/src/SleepingOwl/Admin/Commands/Compilers/ModelCompiler.php b/src/SleepingOwl/Admin/Commands/Compilers/ModelCompiler.php index cbe8c99f..ea48366c 100644 --- a/src/SleepingOwl/Admin/Commands/Compilers/ModelCompiler.php +++ b/src/SleepingOwl/Admin/Commands/Compilers/ModelCompiler.php @@ -113,7 +113,7 @@ protected function renderColumn($type, $column, $title) ':field' => $column, ':title' => $title ]); - if ($this->hasRelation($column, HasMany::class)) + if ($this->hasRelation($column, '\Illuminate\Database\Eloquent\Relations\HasMany')) { $appendTemplate = ";//->append(Column::filter(':foreignKey')->model(:foreignModel::class));"; $relation = $this->getRelation($column); @@ -126,7 +126,7 @@ protected function renderColumn($type, $column, $title) return $result; } $first = $this->getFirstPart($column); - if ($this->hasRelation($first, BelongsTo::class)) + if ($this->hasRelation($first, '\Illuminate\Database\Eloquent\Relations\BelongsTo')) { $appendTemplate = "->append(Column::filter(':foreignKey')->value(':first.id'));"; $relation = $this->getRelation($first); @@ -178,11 +178,11 @@ protected function guessType($column) { return 'image'; } - if ($this->hasRelation($column, HasMany::class)) + if ($this->hasRelation($column, '\Illuminate\Database\Eloquent\Relations\HasMany')) { return 'count'; } - if ($this->hasRelation($this->getFirstPart($column), BelongsToMany::class)) + if ($this->hasRelation($this->getFirstPart($column), '\Illuminate\Database\Eloquent\Relations\BelongsToMany')) { return 'lists'; } @@ -198,15 +198,15 @@ protected function guessType($column) */ protected function guessWith($column) { - if ($this->hasRelation($column, HasMany::class)) + if ($this->hasRelation($column, '\Illuminate\Database\Eloquent\Relations\HasMany')) { $this->with[] = $column; } else { $first = $this->getFirstPart($column); if ($this->hasRelation($first, [ - BelongsTo::class, - BelongsToMany::class + '\Illuminate\Database\Eloquent\Relations\BelongsTo', + '\Illuminate\Database\Eloquent\Relations\BelongsToMany' ]) ) {