1
0

big update base struktur tahap 1

This commit is contained in:
Wian Drs
2026-07-27 16:24:09 +07:00
parent 2b3592c4c2
commit 1dd02baa72
169 changed files with 24405 additions and 977 deletions
+50
View File
@@ -0,0 +1,50 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class MenuGroup extends Model
{
protected $table = 'menu_groups';
protected $fillable = [
'tenant_id',
'name',
'description',
'is_system',
'is_active',
];
protected $casts = [
'is_active' => 'boolean',
'is_system' => 'boolean',
];
public function menus()
{
return $this->belongsToMany(
MenuList::class,
'menu_group_menus',
'menu_group_id',
'menu_id'
)->withPivot([
'can_view',
'can_create',
'can_update',
'can_delete',
'can_approve',
'can_export',
])->withTimestamps();
}
public function userMenuGroups()
{
return $this->hasMany(UserMenuGroup::class, 'menu_group_id');
}
public function tenant()
{
return $this->belongsTo(Tenant::class);
}
}