'boolean', 'sort_order' => 'integer', ]; /* |-------------------------------------------------------------------------- | Relationships |-------------------------------------------------------------------------- */ public function parent() { return $this->belongsTo(self::class, 'parent_id'); } public function children() { return $this->hasMany(self::class, 'parent_id'); } public function menuGroups() { return $this->belongsToMany( MenuGroup::class, 'menu_group_menus', 'menu_id', 'menu_group_id' )->withPivot([ 'can_view', 'can_create', 'can_update', 'can_delete', 'can_approve', 'can_export', ])->withTimestamps(); } }