Refactor script
This commit is contained in:
27
app/Models/UserGroup.php
Normal file
27
app/Models/UserGroup.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use MongoDB\Laravel\Eloquent\Model;
|
||||
|
||||
class UserGroup extends Model
|
||||
{
|
||||
protected $connection = 'mongodb';
|
||||
protected $collection = 'user_groups';
|
||||
|
||||
protected $fillable = [
|
||||
'name', // Nama Grup (misal: "Sales Supervisor")
|
||||
'code', // Kode unik (misal: "SALES_SPV")
|
||||
'description', // Keterangan
|
||||
'agent_id', // ID Agent pemilik grup ini (null jika global/system default)
|
||||
'allowed_menu_ids', // Array of AppMenu IDs (String) ["id1", "id2"]
|
||||
'is_active',
|
||||
'is_system', // true jika grup bawaan sistem (tidak bisa dihapus)
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'allowed_menu_ids' => 'array',
|
||||
'is_active' => 'boolean',
|
||||
'is_system' => 'boolean',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user