Closed tomcrofty closed 2 years ago
For anyone wondering, the current best implementation is to edit the value of the column, like below:
$table->column('next_bill')->value(function(User $user) {
return $user->next_bill->diffForHumans();
})->sortable()->title('Next Bill');
Hi @tomcrofty, thanks for the proposal, I would accept a tested PR for this addition 👍🏻
Closing this as creating formatters is a feature that will be available in V5.
diffForHumans() is a function of a Carbon DateTime object, with the current dateTimeFormat() function we can only use traditional PHP date formatting methods. This implementation would be really fantastic.
Loving this package, thanks a bunch :D