Laravel-datatables: How to calculate a value from data in table

Created on 5 Mar 2019  路  2Comments  路  Source: yajra/laravel-datatables

hi
I have a question.

assume I have a field in my table that its name is consume and this is boolean

I wanna show in the table if consume==1 then 'YES'
and if consume ==0 then 'NO'

how I can do that?

question

Most helpful comment

return Datatables::eloquent($records)
->editColumn('consume', '{{$consume ? "YES" : "NO" }}')

The documentation for this can be found here

All 2 comments

@yajra

return Datatables::eloquent($records)
->editColumn('consume', '{{$consume ? "YES" : "NO" }}')

The documentation for this can be found here

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mopster picture Mopster  路  3Comments

alejandri picture alejandri  路  3Comments

kamrava picture kamrava  路  3Comments

hohuuhau picture hohuuhau  路  3Comments

t0n1zz picture t0n1zz  路  3Comments