Translate a sentence from Mysql to to Eloquent, laravel drivers 5.4

0

Hello I still do not know much about how to pass the queries to laravel, I have the following (which runs perfectly what I want in Mysql):

query in mysql

  

'select distinct a.temario as Event, count (b.id) as Participants from   events a, users b, assistance c where c.evento_id = a.id and c.user_id = b.id

and in the laravel driver

public function index()
{ 

     $asistir=DB::raw('asistencia as m', 'evento as a', 'User as b') 
     ->distinct('a.temario as evento', count('b.id as Participantes from evento', 'users b', 'asistencia c'))
     ->where('c.evento_id','=',$id)

     ->paginate(10);


    return view('vistas.detalleEvento.form',["asistencia"=>$asistir]);
}

but it does not work for me they could help me

    
asked by darling peralta 04.11.2017 в 18:05
source

0 answers