Ejemplo n.º 1
0
 public function getFileMission($language, $id)
 {
     if (!$this->setupLanguage($language)) {
         App::abort(404);
     }
     // Redirection de l'utilisateur s'il est pas connecté :
     if (!Auth::check()) {
         return Redirect::to(URL::to($language . '/home'));
     }
     try {
         $mission = Missions::where('_id', "=", $id)->firstOrFail();
         return Response::download(app_path() . "/" . $mission->_file);
     } catch (Exception $e) {
         App::abort(404);
     }
 }