BookCase::query() ->select(['id', 'latitude', 'longitude']) ->withCount('orangePills') ->get() ->map(fn($bookCase) => [ 'lat' => $bookCase->latitude, 'lng' => $bookCase->longitude, 'url' => url()->route('bookCases.table.bookcases', [ 'country' => $this->country, 'bookcases' => [ 'filters' => [ 'byids' => $bookCase->id, ] ] ]), 'op' => $bookCase->orange_pills_count, ]) ->toArray(), ])->layout('layouts.app', [ 'SEOData' => new SEOData( title: __('World Map of Bookcases'), description: __('On this map you can see bookcases that have been orange pilled. You can also click on a marker to go to the search result.'), image: asset('img/world_map_bookcases.png') ) ]); } }