Files
einundzwanzig-portal/app/Http/Livewire/Tables/MeetupEventTable.php
Benjamin Takats 2d3c63457a footer changed
2022-12-12 19:17:09 +01:00

50 lines
1.5 KiB
PHP

<?php
namespace App\Http\Livewire\Tables;
use Rappasoft\LaravelLivewireTables\DataTableComponent;
use Rappasoft\LaravelLivewireTables\Views\Column;
use App\Models\MeetupEvent;
class MeetupEventTable extends DataTableComponent
{
public string $country;
protected $model = MeetupEvent::class;
public function configure(): void
{
$this->setPrimaryKey('id')
->setThAttributes(function (Column $column) {
return [
'class' => 'px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:bg-gray-800 dark:text-gray-400',
'default' => false,
];
})
->setTdAttributes(function (Column $column, $row, $columnIndex, $rowIndex) {
return [
'class' => 'px-6 py-4 text-sm font-medium dark:text-white',
'default' => false,
];
})
->setColumnSelectStatus(false)
->setPerPage(50);
}
public function columns(): array
{
return [
Column::make(__('Location'), 'location')
->sortable(),
Column::make(__('Start'), 'start')
->sortable(),
Column::make(__('Link'), 'link')
->sortable(),
Column::make("Created at", "created_at")
->sortable(),
Column::make("Updated at", "updated_at")
->sortable(),
];
}
}