public function store(Request $request)
    {
        try {
            $validation = app(ValidationService::class)->check(Menu::$rules);

            if (!$validation['errors']) {
                $menu = $this->repository->store($request->all());
                Cms::notification('Menu saved successfully.', 'success');

                if (!$menu) {
                    Cms::notification('Menu could not be saved.', 'danger');
                }
            } else {
                return $validation['redirect'];
            }
        } catch (Exception $e) {
            Cms::notification($e->getMessage() ?: 'Menu could not be saved.', 'danger');
        }

        return redirect(route($this->routeBase.'.menus.edit', [$menu->id]));
    }
public function store(Request $request)
    {
        try {
            $validation = app(ValidationService::class)->check(Menu::$rules);

            if (!$validation['errors']) {
                $menu = $this->repository->store($request->all());
                Cms::notification('Menu saved successfully.', 'success');

                if (!$menu) {
                    Cms::notification('Menu could not be saved.', 'danger');
                }
            } else {
                return $validation['redirect'];
            }
        } catch (Exception $e) {
            Cms::notification($e->getMessage() ?: 'Menu could not be saved.', 'danger');
        }

        return redirect(route($this->routeBase.'.menus.edit', [$menu->id]));
    }
public function store ( Request $ request ) { try { $ validation = app ( ValidationService :: class ) -> check ( Menu :: $ rules ) ; if ( ! $ validation [ 'errors' ] ) { $ menu = $ this -> repository -> store ( $ request -> all ( ) ) ; Cms :: notification ( 'Menu saved successfully.' , 'success' ) ; if ( ! $ menu ) { Cms :: notification ( 'Menu could not be saved.' , 'danger' ) ; } } else { return $ validation [ 'redirect' ] ; } } catch ( Exception $ e ) { Cms :: notification ( $ e -> getMessage ( ) ? : 'Menu could not be saved.' , 'danger' ) ; } return redirect ( route ( $ this -> routeBase . '.menus.edit' , [ $ menu -> id ] ) ) ; }
Store a newly created Menu in storage.

@param MenuRequest $request

@return Response
Store a newly created Menu in storage .