public function syncMenuAssignment($menu, $assignment)
    {
        switch ($assignment) {
            case static::ALL_PAGES:
                $this->menus()->sync([static::ALL_PAGES]);
                break;
            case static::NO_PAGES:
                $this->menus()->detach();
                break;
            case static::SELECTED_PAGES:
                $this->menus()->sync($menu);
                break;
        }

        return $this;
    }
public function syncMenuAssignment($menu, $assignment)
    {
        switch ($assignment) {
            case static::ALL_PAGES:
                $this->menus()->sync([static::ALL_PAGES]);
                break;
            case static::NO_PAGES:
                $this->menus()->detach();
                break;
            case static::SELECTED_PAGES:
                $this->menus()->sync($menu);
                break;
        }

        return $this;
    }
public function syncMenuAssignment ( $ menu , $ assignment ) { switch ( $ assignment ) { case static :: ALL_PAGES : $ this -> menus ( ) -> sync ( [ static :: ALL_PAGES ] ) ; break ; case static :: NO_PAGES : $ this -> menus ( ) -> detach ( ) ; break ; case static :: SELECTED_PAGES : $ this -> menus ( ) -> sync ( $ menu ) ; break ; } return $ this ; }
Sync widget menu assignment.

@param array $menu
@param int   $assignment
@return $this
Sync widget menu assignment .