add media stuff

This commit is contained in:
Benjamin Takats
2022-12-03 19:44:41 +01:00
parent dd206810d9
commit 43d33db0cb
16 changed files with 219 additions and 24 deletions

View File

@@ -13,6 +13,10 @@ class EventTable extends DataTableComponent
protected $model = Event::class;
public bool $viewingModal = false;
public $currentModal;
public function configure(): void
{
$this
@@ -51,6 +55,10 @@ class EventTable extends DataTableComponent
->sortable(),
Column::make("Kurs", "course.name")
->sortable(),
Column::make("Art")
->label(
fn($row, Column $column) => view('columns.events.categories')->withRow($row)
),
Column::make("Von", "from")
->format(
fn($value, $row, Column $column) => $value->asDateTime()
@@ -83,4 +91,20 @@ class EventTable extends DataTableComponent
->whereHas('venue.city.country',
fn($query) => $query->where('countries.code', $this->country));
}
public function viewHistoryModal($modelId): void
{
$this->viewingModal = true;
$this->currentModal = Event::findOrFail($modelId);
}
public function resetModal(): void
{
$this->reset('viewingModal', 'currentModal');
}
public function customView(): string
{
return 'modals.events.register';
}
}