jeudi 17 novembre 2016

Use IF statement on Eloquent

there is a way to use a IF statement on eloquent?

I have one table called 'invoices' ..

invoices(invoiceId,debt,status)

Status represents if the invoice is payed or not, and debt is the debt on the invoice. I'm asking if there is a quick way to update status in such a way that when I make a payment..

if invoice.debt = 0 then invoice.status = 0
else invoice.status = 1

I'm using laravel 5.3. Thank You!

Aucun commentaire:

Enregistrer un commentaire