You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
892 B
40 lines
892 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
class AdminMenu extends Model
|
|
{
|
|
use HasFactory, Notifiable, SoftDeletes;
|
|
|
|
protected $table = 'admin_menu';
|
|
|
|
/**
|
|
* The attributes that should be hidden for serialization.
|
|
* @var array<int, string>
|
|
*/
|
|
protected $hidden
|
|
= [
|
|
'updated_at',
|
|
'deleted_at',
|
|
];
|
|
|
|
/**
|
|
* A Menu belongs to many roles.
|
|
* @return BelongsToMany
|
|
*/
|
|
public function roles(): BelongsToMany
|
|
{
|
|
return $this->belongsToMany(
|
|
AdminRoles::class,
|
|
AdminRoleMenu::class,
|
|
'menu_id',
|
|
'role_id'
|
|
);
|
|
}
|
|
}
|
|
|