41 lines
819 B
PHP
41 lines
819 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class MenuGroupMenu extends Model
|
|
{
|
|
protected $table = 'menu_group_menus';
|
|
|
|
protected $fillable = [
|
|
'menu_group_id',
|
|
'menu_id',
|
|
'can_view',
|
|
'can_create',
|
|
'can_update',
|
|
'can_delete',
|
|
'can_approve',
|
|
'can_export',
|
|
];
|
|
|
|
protected $casts = [
|
|
'can_view' => 'boolean',
|
|
'can_create' => 'boolean',
|
|
'can_update' => 'boolean',
|
|
'can_delete' => 'boolean',
|
|
'can_approve' => 'boolean',
|
|
'can_export' => 'boolean',
|
|
];
|
|
|
|
public function menuGroup()
|
|
{
|
|
return $this->belongsTo(MenuGroup::class, 'menu_group_id');
|
|
}
|
|
|
|
public function menu()
|
|
{
|
|
return $this->belongsTo(MenuList::class, 'menu_id');
|
|
}
|
|
}
|