)->summarize(Summarizer::make()->label('Total Cost')->using( function (Table $table) { dd($table->getColumns()['total_cost']); //echo `<script>console.log($price)</script>`; //dd($table->getColumn('total_cost')->getState()); } )),
Tables\Columns\TextColumn::make('total_cost')->label('Total Cost')->state( function (TrafficLogs $record) { $totalBytes = ($record->bytes_downloaded + $record->bytes_uploaded) / (1024*1024*1024); $type = explode("_", $record->country)[1]; return "$" . round(cost($type, $totalBytes), 2); }