Skip to content

Conversation

yajra
Copy link
Owner

@yajra yajra commented Nov 3, 2020

To compliment yajra/laravel-datatables#2193

    public function dataTable($query)
    {
        return datatables()
            ->eloquent($query)
            ->formatColumn('created_at', DateFormatter::class)
            ->setRowId('id');
    }

    protected function getColumns()
    {
        return [
            Column::make('id'),
            Column::formatted('created_at'),
        ];
    }

@yajra yajra merged commit 5c1f62d into 4.0 Nov 3, 2020
@yajra yajra deleted the formatted-column branch November 3, 2020 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant