app/Http/Controllers/EventController.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)
    {
        $event = new Event([
            'category_id' => $request->get('category'),
            'name' => $request->get('name')
        ]);
        $event->save();
        return redirect('/home')->with('success', 'Event Saved');
    }
public function store ( Request $ request ) { $ event = new Event ( [ 'category_id' => $ request -> get ( 'category' ) , 'name' => $ request -> get ( 'name' ) ] ) ; $ event -> save ( ) ; return redirect ( '/home' ) -> with ( 'success' , 'Event Saved' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .