proximity search added

This commit is contained in:
Benjamin Takats
2022-12-03 21:39:41 +01:00
parent 43b8d8a284
commit 4c49243af0
3 changed files with 101 additions and 12 deletions

View File

@@ -73,8 +73,16 @@ class CityTable extends DataTableComponent
->find($id);
$query = City::radius($city->latitude, $city->longitude, 100)
->where('id', '!=', $id);
$this->notification()
->success('Proximity Search', 'Found '.$query->count().' cities. '.$query->pluck('name')
->implode(', '));
return to_route('search.event', [
'#table',
'country' => $this->country,
'table' => [
'filters' => [
'stadt' => $query->pluck('name')
->push($city->name)
->implode(',')
],
]
]);
}
}