mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
feat: make models sluggable
This commit is contained in:
@@ -2,12 +2,14 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Cviebrock\EloquentSluggable\Sluggable;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ChampionSkin extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use Sluggable;
|
||||
|
||||
protected $fillable = [
|
||||
'champion_id',
|
||||
@@ -36,6 +38,15 @@ class ChampionSkin extends Model
|
||||
'splash_artist' => 'array',
|
||||
];
|
||||
|
||||
public function sluggable(): array
|
||||
{
|
||||
return [
|
||||
'slug' => [
|
||||
'source' => 'skin_name'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public function champion()
|
||||
{
|
||||
return $this->belongsTo(Champion::class);
|
||||
|
||||
Reference in New Issue
Block a user