app/Http/Controllers/Admin/AdminmenuController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $this->validate(request(), [
            'menutitle' => 'required|unique:adminmenus',
            'slug' => 'required|unique:adminmenus',
            'urllink' => 'required',
            'displayorder' => 'required'
        ]);
        $adminmenu= new  Adminmenu;
        $adminmenu->menutitle=$request->get('menutitle');
        $adminmenu->slug=$request->get('slug');
        $adminmenu->parentid=$request->get('parentid');
        $adminmenu->showinnav=$request->get('showinnav');
        $adminmenu->setasdefault=$request->get('setasdefault');
        $adminmenu->iconclass=$request->get('iconclass');
        $adminmenu->urllink=$request->get('urllink');
        $adminmenu->displayorder=$request->get('displayorder');
        $adminmenu->mselect=$request->get('mselect');
        $date=date_create($request->get('date'));
        $format = date_format($date,"Y-m-d");
        $adminmenu->created_at = strtotime($format);
        $adminmenu->updated_at = strtotime($format);
        $adminmenu->save();
        return redirect('menu/create')->with('success', 'Navigation mneu has been created successfully.');
        exit;
    }
public function store ( Request $ request ) { $ this -> validate ( request ( ) , [ 'menutitle' => 'required|unique:adminmenus' , 'slug' => 'required|unique:adminmenus' , 'urllink' => 'required' , 'displayorder' => 'required' ] ) ; $ adminmenu = new Adminmenu ; $ adminmenu -> menutitle = $ request -> get ( 'menutitle' ) ; $ adminmenu -> slug = $ request -> get ( 'slug' ) ; $ adminmenu -> parentid = $ request -> get ( 'parentid' ) ; $ adminmenu -> showinnav = $ request -> get ( 'showinnav' ) ; $ adminmenu -> setasdefault = $ request -> get ( 'setasdefault' ) ; $ adminmenu -> iconclass = $ request -> get ( 'iconclass' ) ; $ adminmenu -> urllink = $ request -> get ( 'urllink' ) ; $ adminmenu -> displayorder = $ request -> get ( 'displayorder' ) ; $ adminmenu -> mselect = $ request -> get ( 'mselect' ) ; $ date = date_create ( $ request -> get ( 'date' ) ) ; $ format = date_format ( $ date , " Y-m-d " ) ; $ adminmenu -> created_at = strtotime ( $ format ) ; $ adminmenu -> updated_at = strtotime ( $ format ) ; $ adminmenu -> save ( ) ; return redirect ( 'menu/create' ) -> with ( 'success' , 'Navigation mneu has been created successfully.' ) ; exit ; }
Store a newly created resource in storage.
Store a newly created resource in storage .