4
I have a query with Left Join with AND I’m not able to implement it in Laravel 5.
A snippet of the query:
LEFT JOIN visitante v ON a.codigo = v.id
AND v.data BETWEEN '2015-06-01' and '2016-05-31' and v.status = '1'
I tried it but it didn’t work:
->leftJoin(DB::raw('visitante v ON a.codigo = v.id
AND v.data BETWEEN \'2015-06-01\' and \'2016-05-31\' and v.status = \'1\''))
Is there a mistake? Because it doesn’t work?
– novic
@Virgilionovic Error appears: Missing argument 2 for Illuminate Database Query Builder::leftJoin(), called in /...Controller.php on line 120 and defined which is on this line
– Shaolin Fantastic
The way this query is, if you can use the simplest way by doing all the SQL and going to run, so it won’t work because
leftJoin
does not useDB::Raw
(so far as I know), then do https://laravel.com/docs/5.3/database#running-queries as described on that link. Also has little information to develop an exact answer!– novic
It is I had already seen and not have much information I will continue looking on the Net
– Shaolin Fantastic