Laravel-admin: i need to get some field value in grid

Created on 11 Feb 2019  ·  2Comments  ·  Source: z-song/laravel-admin

  • Laravel Version: 5.7
  • PHP Version: 7.2
  • Laravel-admin: Last

i need to get some field value in grid

example

 $a = $grid->getKey('amount');
$b = $grid->getKey('tax');

and finaly add a new column dont exist in the table Total = a * b

wontfix

Most helpful comment

:))))))))) solved

 $grid->column('Total')->display(function () {
            return $this->amount*$this->tax/100;
        });

by using $this-> and the name of column

All 2 comments

:))))))))) solved

 $grid->column('Total')->display(function () {
            return $this->amount*$this->tax/100;
        });

by using $this-> and the name of column

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

greentornado picture greentornado  ·  3Comments

joernroeder picture joernroeder  ·  3Comments

clock1129 picture clock1129  ·  3Comments

piian picture piian  ·  3Comments

wangwenfan picture wangwenfan  ·  3Comments