mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
meetups added
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace App\Http\Livewire\Tables;
|
||||
|
||||
use App\Models\Category;
|
||||
use App\Models\Event;
|
||||
use App\Models\CourseEvent;
|
||||
use App\Models\Lecturer;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Rappasoft\LaravelLivewireTables\DataTableComponent;
|
||||
@@ -17,7 +17,7 @@ class EventTable extends DataTableComponent
|
||||
public string $country;
|
||||
public bool $viewingModal = false;
|
||||
public $currentModal;
|
||||
protected $model = Event::class;
|
||||
protected $model = CourseEvent::class;
|
||||
|
||||
public function configure(): void
|
||||
{
|
||||
@@ -157,18 +157,18 @@ class EventTable extends DataTableComponent
|
||||
|
||||
public function builder(): Builder
|
||||
{
|
||||
return Event::query()
|
||||
->withCount([
|
||||
return CourseEvent::query()
|
||||
->withCount([
|
||||
'registrations',
|
||||
])
|
||||
->whereHas('venue.city.country',
|
||||
->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);
|
||||
$this->currentModal = CourseEvent::findOrFail($modelId);
|
||||
}
|
||||
|
||||
public function resetModal(): void
|
||||
|
||||
35
app/Http/Livewire/Tables/MeetupEventTable.php
Normal file
35
app/Http/Livewire/Tables/MeetupEventTable.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
29
app/Http/Livewire/Tables/MeetupTable.php
Normal file
29
app/Http/Livewire/Tables/MeetupTable.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\Tables;
|
||||
|
||||
use App\Models\Meetup;
|
||||
use Rappasoft\LaravelLivewireTables\DataTableComponent;
|
||||
use Rappasoft\LaravelLivewireTables\Views\Column;
|
||||
|
||||
class MeetupTable extends DataTableComponent
|
||||
{
|
||||
public string $country;
|
||||
|
||||
protected $model = Meetup::class;
|
||||
|
||||
public function configure(): void
|
||||
{
|
||||
$this->setPrimaryKey('id');
|
||||
}
|
||||
|
||||
public function columns(): array
|
||||
{
|
||||
return [
|
||||
Column::make(__('Name'), 'name')
|
||||
->sortable(),
|
||||
Column::make(__('Link'), 'link')
|
||||
->sortable(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user