Closed
Description
Summary of problem or feature request
When overriding the getter for the created_at on the model level, the column will display [object object] rather than the formatted datetime. By default, created_at passes as a Carbon object so it can be used in other areas and by being able to call ->format
on it. The only work around I found for this is doing an editColumn and then formatting it from there. It just seems tedious that Datatables doesn't support Carbon objects.
Code snippet of problem
public function getCreatedAtAttribute()
{
return now()->parse($this->attributes['created_at'])->setTimezone('America/New_York');
}
System details
- Operating System
AlmaLinux 8.7 - PHP Version
8.2 - Laravel Version
10 - Laravel-Datatables Version
10