vendredi 13 juillet 2018

eloquent laravel complex join

I'm trying to execute this query in laravel 5.2 but I get this ERRROR:

Call to undefined method Illuminate\Database\Query\JoinClause::join()

$this->model>with(['rela1','rela2', 'rela3' ,'rel4', 'rela5'....])
                    ->join('table1',function ($q){
                        $q->where('table1.id','=','table2.id')
                            ->join('table3')
                            ->where('table3.nro','=','table2.id')
                            ->where('table3.user',\Auth::user()->id);



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire