Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Commit

Permalink
replaced deprecated Laravel helper functions with their stable methods
Browse files Browse the repository at this point in the history
  • Loading branch information
zbiller committed Mar 22, 2019
1 parent 653c547 commit da6cbf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/Traits/HasSlug.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Neurony\Url\Traits;

use Illuminate\Support\Str;
use Neurony\Url\Options\SlugOptions;
use Illuminate\Database\Eloquent\Model;
use Neurony\Url\Exceptions\SlugException;
Expand Down Expand Up @@ -104,12 +105,12 @@ protected function generateNonUniqueSlug(): string
if ($this->slugHasChanged()) {
$source = $this->getAttribute($this->slugOptions->toField);

return str_is('/', $source) ? $source : str_slug($source);
return Str::is('/', $source) ? $source : Str::slug($source);
}

$source = $this->getSlugSource();

return str_is('/', $source) ? $source : str_slug(
return Str::is('/', $source) ? $source : Str::slug(
$source, $this->slugOptions->slugSeparator, $this->slugOptions->slugLanguage
);
}
Expand Down
5 changes: 3 additions & 2 deletions src/Traits/HasUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Neurony\Url\Traits;

use Exception;
use Illuminate\Support\Str;
use Neurony\Url\Models\Url;
use Illuminate\Support\Facades\DB;
use Neurony\Url\Options\UrlOptions;
Expand Down Expand Up @@ -258,9 +259,9 @@ protected function buildFullUrl(): string
$suffix = $this->buildUrlSegment('suffix');

return
(str_is('/', $prefix) ? '' : ($prefix ? $prefix.$this->urlOptions->urlGlue : '')).
(Str::is('/', $prefix) ? '' : ($prefix ? $prefix.$this->urlOptions->urlGlue : '')).
$this->getAttribute($this->urlOptions->toField).
(str_is('/', $suffix) ? '' : ($suffix ? $this->urlOptions->urlGlue.$suffix : ''));
(Str::is('/', $suffix) ? '' : ($suffix ? $this->urlOptions->urlGlue.$suffix : ''));
}

/**
Expand Down

0 comments on commit da6cbf0

Please sign in to comment.