public function destroy($eventoId)
 {
     $participante = Participante::where('usuario_id', Auth::user()->id)->where('evento_id', $eventoId);
     if ($participante->delete()) {
         return redirect()->action('BackendController@index')->with('statusParticipante', 'Presença cancelada.');
     }
 }
Exemplo n.º 2
0
 public function usuarioEstaParticipando($usuarioId, $eventoId)
 {
     $participante = Participante::where('usuario_id', $usuarioId)->where('evento_id', $eventoId)->first();
     if (empty($participante)) {
         return false;
     }
     return true;
 }