mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
heatmap added
This commit is contained in:
25
app/Http/Livewire/BookCase/Heatmap.php
Normal file
25
app/Http/Livewire/BookCase/Heatmap.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\BookCase;
|
||||
|
||||
use App\Models\BookCase;
|
||||
use Livewire\Component;
|
||||
|
||||
class Heatmap extends Component
|
||||
{
|
||||
public string $country;
|
||||
|
||||
public function render()
|
||||
{
|
||||
$data = BookCase::query()
|
||||
->whereHas('orangePills')
|
||||
->get()->map(fn($bookCase) => [
|
||||
'lat' => $bookCase->latitude,
|
||||
'lng' => $bookCase->longitude,
|
||||
]);
|
||||
|
||||
return view('livewire.book-case.heatmap', [
|
||||
'heatmap_data' => $data,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user