2025-12-01 08:24:59 +07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
|
|
|
|
use Spatie\Permission\Models\Permission as SpatiePermission;
|
|
|
|
|
|
|
|
|
|
class Permission extends SpatiePermission
|
|
|
|
|
{
|
|
|
|
|
use HasUuids;
|
|
|
|
|
|
|
|
|
|
protected $primaryKey = 'uuid';
|
|
|
|
|
public $incrementing = false;
|
|
|
|
|
protected $keyType = 'string';
|
2025-12-02 17:36:19 +07:00
|
|
|
|
|
|
|
|
// Spatie masih memakai kolom "id" di beberapa operasi, jadi kembalikan nilai uuid.
|
|
|
|
|
public function getIdAttribute(): ?string
|
|
|
|
|
{
|
|
|
|
|
return $this->attributes['uuid'] ?? null;
|
|
|
|
|
}
|
2025-12-01 08:24:59 +07:00
|
|
|
}
|