public function store(WidgetFormRequest $request)
    {
        $widget = new Widget;
        $widget->fill($request->all());
        $widget->published     = $request->get('published', false);
        $widget->authenticated = $request->get('authenticated', false);
        $widget->show_title    = $request->get('show_title', false);
        $widget->save();

        $widget->syncPermissions($request->get('permissions', []));
        $widget->syncMenuAssignment($request->get('menu', []), $request->get('assignment', Widget::ALL_PAGES));

        flash()->success(trans('cms::widget.store.success'));

        return redirect()->route('administrator.widgets.index');
    }
public function store(WidgetFormRequest $request)
    {
        $widget = new Widget;
        $widget->fill($request->all());
        $widget->published     = $request->get('published', false);
        $widget->authenticated = $request->get('authenticated', false);
        $widget->show_title    = $request->get('show_title', false);
        $widget->save();

        $widget->syncPermissions($request->get('permissions', []));
        $widget->syncMenuAssignment($request->get('menu', []), $request->get('assignment', Widget::ALL_PAGES));

        flash()->success(trans('cms::widget.store.success'));

        return redirect()->route('administrator.widgets.index');
    }
public function store ( WidgetFormRequest $ request ) { $ widget = new Widget ; $ widget -> fill ( $ request -> all ( ) ) ; $ widget -> published = $ request -> get ( 'published' , false ) ; $ widget -> authenticated = $ request -> get ( 'authenticated' , false ) ; $ widget -> show_title = $ request -> get ( 'show_title' , false ) ; $ widget -> save ( ) ; $ widget -> syncPermissions ( $ request -> get ( 'permissions' , [ ] ) ) ; $ widget -> syncMenuAssignment ( $ request -> get ( 'menu' , [ ] ) , $ request -> get ( 'assignment' , Widget :: ALL_PAGES ) ) ; flash ( ) -> success ( trans ( 'cms::widget.store.success' ) ) ; return redirect ( ) -> route ( 'administrator.widgets.index' ) ; }
Store a newly created widget.

@param \Yajra\CMS\Http\Requests\WidgetFormRequest $request
@return \Illuminate\Http\RedirectResponse
Store a newly created widget .