/**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateDataUpdateRequest $request)
 {
     $result = DataUpdate::create($request->all());
     Session::flash('message', $result->id . ' Añadido Con Exito');
     //return Redirect::away('http://evaluacion.ul.edu.co/', 301);
     return Redirect::to('logout');
 }
Beispiel #2
0
 public function handle($request, Closure $next, $guard = null)
 {
     if (Auth::guard($guard)->guest()) {
         if ($request->ajax()) {
             return response('Unauthorized.', 401);
         } else {
             return redirect()->guest('login');
         }
     } else {
         $id = Auth::user()->id;
         $result = \App\DataUpdate::where('user_id', $id)->first();
         if ($result == '') {
             if ($request->ajax()) {
                 return response('Unauthorized.', 401);
             } else {
                 return redirect()->guest('student/data_update/create');
             }
         }
     }
     return $next($request);
 }