public function logout()
 {
     //
     Auth::logout();
     // logout user
     return Redirect::to('/')->with('events', event::all())->with('allDayEvent', allDayEvent::all());
     //redirect back to login
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request, $id)
 {
     $this->validate($request, ['allEventName' => 'required|max:50', 'allDayEventTime' => 'required', 'allDayEventTimeEnd' => 'required', 'allEventImgLink' => 'required|max:4']);
     $allDayEvent = allDayEvent::find($id);
     $allDayEvent->allEventName = Input::get('allEventName');
     $allDayEvent->allDayEventTime = Input::get('allDayEventTime');
     $allDayEvent->allDayEventTimeEnd = Input::get('allDayEventTimeEnd');
     $allDayEvent->allEventImgLink = Input::get('allEventImgLink');
     if ($allDayEvent->save()) {
         return Redirect::to('admin');
     } else {
         return Redirect::back()->withInput()->withErrors('Something Error');
     }
 }
Example #3
0
 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     return view('index')->with('events', event::all())->with('allDayEvent', allDayEvent::all());
 }