feat: Create TimestampColumns class for managing created_at, updated_at, and deleted_at timestamps in Filament tables.
This commit is contained in:
parent
923b722ed3
commit
b87b9fee96
34
app/Filament/Columns/TimestampColumns.php
Normal file
34
app/Filament/Columns/TimestampColumns.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Columns;
|
||||||
|
|
||||||
|
use Filament\Tables\Columns\TextColumn;
|
||||||
|
|
||||||
|
class TimestampColumns
|
||||||
|
{
|
||||||
|
public static function make(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
TextColumn::make('created_at')
|
||||||
|
->label('Dibuat')
|
||||||
|
->sortable()
|
||||||
|
->toggleable(isToggledHiddenByDefault: true)
|
||||||
|
->dateTime('l, d F Y H:i:s')
|
||||||
|
->wrap(),
|
||||||
|
|
||||||
|
TextColumn::make('updated_at')
|
||||||
|
->label('Diperbarui')
|
||||||
|
->sortable()
|
||||||
|
->toggleable(isToggledHiddenByDefault: true)
|
||||||
|
->dateTime('l, d F Y H:i:s')
|
||||||
|
->wrap(),
|
||||||
|
|
||||||
|
TextColumn::make('deleted_at')
|
||||||
|
->label('Dihapus')
|
||||||
|
->sortable()
|
||||||
|
->toggleable(isToggledHiddenByDefault: true)
|
||||||
|
->dateTime('l, d F Y H:i:s')
|
||||||
|
->wrap(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user