I need total to be automatically updated when I update the rate value. Normally I'd achieve that from my Eloquent model like this
---Model.php
protected static function boot()
{
parent::boot();
self::updating(function($model){
$model->total = $model->rate //(or some similar logic)
}
This works when I do a manual update of the model from my other view but when I use the Livewire datatable, the update doesn't take place on the 'total' column. Any ideas how to work around this?
I have two columns 'rate' and 'total' in my model and my Datatable has the following columns
I need total to be automatically updated when I update the rate value. Normally I'd achieve that from my Eloquent model like this
---Model.php
This works when I do a manual update of the model from my other view but when I use the Livewire datatable, the update doesn't take place on the 'total' column. Any ideas how to work around this?