first commit
This commit is contained in:
32
backend/app/Models/Auth/Permissions.php
Normal file
32
backend/app/Models/Auth/Permissions.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Auth;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Permissions extends Model{
|
||||
|
||||
protected $casts = [
|
||||
'hidden' => 'integer',
|
||||
'hiddenBreadcrumb' => 'integer',
|
||||
'affix' => 'integer',
|
||||
'fullpage' => 'integer',
|
||||
];
|
||||
protected $appends = ['meta'];
|
||||
|
||||
protected function meta(): Attribute{
|
||||
return Attribute::make(
|
||||
get: fn ($value, $data) => [
|
||||
'title' => $data['title'],
|
||||
'type' => $data['type'],
|
||||
'icon' => $data['icon'],
|
||||
'color' => $data['color'],
|
||||
'hidden' => $data['hidden'],
|
||||
'hiddenBreadcrumb' => $data['hiddenBreadcrumb'],
|
||||
'affix' => $data['affix'],
|
||||
'fullpage' => $data['fullpage'],
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user