<?php

namespace App\Models;

use Backpack\PermissionManager\app\Models\Permission as OriginalPermission;
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\Sluggable;
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\SluggableScopeHelpers;
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;

class Permission extends OriginalPermission
{
    use HasTranslations;
    use Sluggable, SluggableScopeHelpers;
    public $translatable = ['name'];
    protected $fillable = ['slug', 'name', 'guard_name', 'updated_at', 'created_at'];

    /**
     * Return the sluggable configuration array for this model.
     *
     * @return array
     */
    public function sluggable(): array
    {
        return [
            'slug' => [
                'source' => 'slug_or_name',
            ],
        ];
    }
}
