samedi 11 août 2018

Laravel eloquent using null as column value on select?

How to use null as column value in the Laravel eloquent like in the following query (The below query is not working and its for an example).

$query = \DB::table('invoices as inv')
        ->leftjoin('customer as c', 'c.id', '=', 'inv.customer_id')
        ->select([
            'inv.id',
            'inv.invoice_date',
            'inv.invoice_no',
            'null as voucher_no',
            'null as credit',
        ]);

Here, 'null as voucher_no' is not working. How to use null inside this query.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire