Skip to content

Commit e019150

Browse files
authored
Merge pull request #3746 from Laravel-Backpack/remove-overrides
Remove overrides for Cviebrock Sluggable
2 parents 09cf360 + 5ab568b commit e019150

File tree

3 files changed

+0
-138
lines changed

3 files changed

+0
-138
lines changed

src/app/Models/Traits/SpatieTranslatable/Sluggable.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,15 @@
44

55
use Cviebrock\EloquentSluggable\Sluggable as OriginalSluggable;
66
use Illuminate\Database\Eloquent\Builder;
7-
use Illuminate\Database\Eloquent\Model;
87

98
trait Sluggable
109
{
1110
use OriginalSluggable;
1211

13-
/**
14-
* Hook into the Eloquent model events to create or
15-
* update the slug as required.
16-
*/
17-
public static function bootSluggable()
18-
{
19-
static::observe(app(SluggableObserver::class));
20-
}
21-
22-
/**
23-
* Clone the model into a new, non-existing instance.
24-
*
25-
* @param array|null $except
26-
*
27-
* @return Model
28-
*/
29-
public function replicate(array $except = null): Model
30-
{
31-
$instance = parent::replicate($except);
32-
(new SlugService())->slug($instance, true);
33-
34-
return $instance;
35-
}
36-
3712
/**
3813
* Query scope for finding "similar" slugs, used to determine uniqueness.
3914
*
4015
* @param \Illuminate\Database\Eloquent\Builder $query
41-
* @param \Illuminate\Database\Eloquent\Model $model
4216
* @param string $attribute
4317
* @param array $config
4418
* @param string $slug

src/app/Models/Traits/SpatieTranslatable/SluggableObserver.php

Lines changed: 0 additions & 84 deletions
This file was deleted.

src/app/Models/Traits/SpatieTranslatable/SluggableScopeHelpers.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,4 @@ public function scopeWhereSlug(Builder $scope, string $slug): Builder
2121
{
2222
return $scope->where($this->getSlugKeyName().'->'.$this->getLocale(), $slug);
2323
}
24-
25-
/**
26-
* Find a model by its primary slug.
27-
*
28-
* @param string $slug
29-
* @param array $columns
30-
*
31-
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|null
32-
*/
33-
public static function findBySlug(string $slug, array $columns = ['*'])
34-
{
35-
return static::whereSlug($slug)->first($columns);
36-
}
37-
38-
/**
39-
* Find a model by its primary slug or throw an exception.
40-
*
41-
* @param string $slug
42-
* @param array $columns
43-
*
44-
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
45-
*
46-
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection
47-
*/
48-
public static function findBySlugOrFail(string $slug, array $columns = ['*'])
49-
{
50-
return static::whereSlug($slug)->firstOrFail($columns);
51-
}
5224
}

0 commit comments

Comments
 (0)