app/Http/Controllers/MenuController.php
/**
   * Function to store new menu item, also gives it new maximum weight
   * @param MenuRequest $request
   * @return mixed
   */
Function to store new menu item, also gives it new maximum weight
@param MenuRequest $request
@return mixed
Function to store new menu item also gives it new maximum weight @param MenuRequest $request @return mixed
public function store(MenuRequest $request){
    $Menu = new Menu();
    $this->maximizeMenuWeight($Menu);
    $Menu->title = $request->title;
    $Menu->url = $request->url;
    if($request->published == true){
      $Menu->published = $request->published;
    }
    else {
      $Menu->published = false;
    }
    $Menu->save();
    $message = 'Новий пункт меню створено';
    return redirect('menus-list')->with('message', $message);
  }
public function store ( MenuRequest $ request ) { $ Menu = new Menu ( ) ; $ this -> maximizeMenuWeight ( $ Menu ) ; $ Menu -> title = $ request -> title ; $ Menu -> url = $ request -> url ; if ( $ request -> published == true ) { $ Menu -> published = $ request -> published ; } else { $ Menu -> published = false ; } $ Menu -> save ( ) ; $ message = 'Новий пункт меню створено'; return redirect ( 'menus-list' ) -> with ( 'message' , $ message ) ; }
Function to store new menu item, also gives it new maximum weight
 @param MenuRequest $request
 @return mixed
Function to store new menu item also gives it new maximum weight @param MenuRequest $request @return mixed