コード例 #1
0
 public function index()
 {
     //Obtem todas as acoes para serem listadas
     $hoje = getdate();
     $hoje2 = $hoje['year'] . '-' . $hoje['mon'] . '-' . $hoje['mday'];
     $acaos = DB::table('acaos')->select('*')->where('data_sorteio', '>=', $hoje2)->where('numrifado', null)->where('deleted_at', null)->get();
     $mensagem = MensagemAdm::all()->last();
     return view('acaos')->with('acaos', $acaos)->with('mensagem', $mensagem);
 }
コード例 #2
0
 /**
  * Render the given HttpException.
  *
  * @param  \Symfony\Component\HttpKernel\Exception\HttpException  $e
  * @return \Symfony\Component\HttpFoundation\Response
  */
 protected function renderHttpException(HttpException $e)
 {
     $status = $e->getStatusCode();
     $hoje = getdate();
     $hoje2 = $hoje['year'] . '-' . $hoje['mon'] . '-' . $hoje['mday'];
     $mensagem = MensagemAdm::all()->last();
     $acaos = DB::table('acaos')->select('*')->where('data_sorteio', '>=', $hoje2)->where('deleted_at', null)->where('winner_id', null)->get();
     $criador = DB::table('users')->select('*')->join('acaos', 'users.id', '=', 'acaos.user_id')->get();
     $rifas = DB::table('rifas')->select('*')->join('users', 'rifas.user_id', '=', 'users.id')->whereNotNull('user_id')->groupby('name', 'acao_id')->get();
     if (view()->exists("errors.{$status}")) {
         return response()->view("errors.{$status}", ['exception' => $e, 'mensagem' => $mensagem, 'acaos' => $acaos, 'criador' => $criador, 'rifas' => $rifas], $status, $e->getHeaders());
     } else {
         return $this->convertExceptionToResponse($e);
     }
 }