mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
osm data
This commit is contained in:
51
app/Http/Livewire/Tables/MeetupForBtcMapTable.php
Normal file
51
app/Http/Livewire/Tables/MeetupForBtcMapTable.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\Tables;
|
||||
|
||||
use App\Models\Meetup;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Rappasoft\LaravelLivewireTables\DataTableComponent;
|
||||
use Rappasoft\LaravelLivewireTables\Views\Column;
|
||||
|
||||
class MeetupForBtcMapTable extends DataTableComponent
|
||||
{
|
||||
public function configure(): void
|
||||
{
|
||||
$this
|
||||
->setPrimaryKey('id')
|
||||
->setAdditionalSelects([
|
||||
'osm_relation',
|
||||
'simplified_geojson',
|
||||
'population',
|
||||
'population_date',
|
||||
])
|
||||
->setPerPageAccepted([
|
||||
100000,
|
||||
])
|
||||
->setPerPage(100000);
|
||||
}
|
||||
|
||||
public function columns(): array
|
||||
{
|
||||
return [
|
||||
Column::make("Id", "id")
|
||||
->sortable(),
|
||||
Column::make("Name", "name")
|
||||
->sortable(),
|
||||
Column::make("City", "city.name")
|
||||
->sortable(),
|
||||
Column::make("Country", "city.country.name")
|
||||
->sortable(),
|
||||
Column::make("Actions")
|
||||
->label(fn($row, Column $column) => view('columns.meetups.osm-actions', ['row' => $row])),
|
||||
];
|
||||
}
|
||||
|
||||
public function builder(): Builder
|
||||
{
|
||||
return Meetup::query()
|
||||
->with([
|
||||
'city.country',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user