Skip to content

Commit

Permalink
Downgrade to PHP 5.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeping-owl committed Oct 16, 2014
1 parent 2c7a3d2 commit 0693d33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/SleepingOwl/Admin/AdminServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php namespace SleepingOwl\Admin;

use SleepingOwl\Admin\Exceptions\ValidationException;
use SleepingOwl\AdminAuth\AdminAuthServiceProvider;
use SleepingOwl\Html\FormBuilder;
use SleepingOwl\Admin\Validation\Validator;
use Illuminate\Support\ServiceProvider;
Expand All @@ -26,8 +25,8 @@ public function register()
{
$this->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();

Expand Down
14 changes: 7 additions & 7 deletions src/SleepingOwl/Admin/Commands/Compilers/ModelCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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';
}
Expand All @@ -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'
])
)
{
Expand Down

0 comments on commit 0693d33

Please sign in to comment.