public function highestOrderMenuItem($parent = null)
    {
        $order = 1;

        $item = $this->where('parent_id', '=', $parent)
            ->orderBy('order', 'DESC')
            ->first();

        if (!is_null($item)) {
            $order = intval($item->order) + 1;
        }

        return $order;
    }
public function highestOrderMenuItem($parent = null)
    {
        $order = 1;

        $item = $this->where('parent_id', '=', $parent)
            ->orderBy('order', 'DESC')
            ->first();

        if (!is_null($item)) {
            $order = intval($item->order) + 1;
        }

        return $order;
    }
public function highestOrderMenuItem ( $ parent = null ) { $ order = 1 ; $ item = $ this -> where ( 'parent_id' , '=' , $ parent ) -> orderBy ( 'order' , 'DESC' ) -> first ( ) ; if ( ! is_null ( $ item ) ) { $ order = intval ( $ item -> order ) + 1 ; } return $ order ; }
Return the Highest Order Menu Item.

@param number $parent (Optional) Parent id. Default null

@return number Order number
Return the Highest Order Menu Item .