Skip to content

Commit

Permalink
Merge pull request #220 from ndinhbang/master
Browse files Browse the repository at this point in the history
compatible with laravel >= 5.7
  • Loading branch information
franzose authored Oct 25, 2019
2 parents 7a97e6f + 279e013 commit 4ed81a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Franzose/ClosureTable/Extensions/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Str extends BaseStr
*/
public static function classify($name)
{
return studly_case(str_singular($name));
return static::studly(static::singular($name));
}

/**
Expand All @@ -31,6 +31,6 @@ public static function tableize($name)
{
$name = str_replace('\\', '', $name);

return (ends_with($name, 'Closure') ? snake_case($name) : snake_case(str_plural($name)));
return (static::endsWith($name, 'Closure') ? static::snake($name) : static::snake(static::plural($name)));
}
}
3 changes: 2 additions & 1 deletion src/Franzose/ClosureTable/Models/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Franzose\ClosureTable\Extensions\QueryBuilder;
use Franzose\ClosureTable\Contracts\EntityInterface;
use Franzose\ClosureTable\Extensions\Collection;
use Illuminate\Support\Arr;

/**
* Basic entity class.
Expand Down Expand Up @@ -1159,7 +1160,7 @@ public static function createFromArray(array $tree, EntityInterface $parent = nu
$entities = [];

foreach ($tree as $item) {
$children = array_pull($item, $childrenRelationIndex);
$children = Arr::pull($item, $childrenRelationIndex);

/**
* @var Entity $entity
Expand Down

0 comments on commit 4ed81a7

Please sign in to comment.