mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions. You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root. For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
42 lines
1.6 KiB
PHP
42 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Livewire\BookCase;
|
|
|
|
use App\Models\BookCase;
|
|
use App\Models\Country;
|
|
use Livewire\Component;
|
|
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
|
|
|
class WorldMap extends Component
|
|
{
|
|
public Country $country;
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.book-case.world-map', [
|
|
'mapData' => BookCase::query()
|
|
->select(['id', 'latitude', 'longitude'])
|
|
->withCount('orangePills')
|
|
->active()
|
|
->get()
|
|
->map(fn ($bookCase) => [
|
|
'lat' => $bookCase->latitude,
|
|
'lng' => $bookCase->longitude,
|
|
'url' => url()->route('bookCases.comment.bookcase',
|
|
[
|
|
'country' => $this->country,
|
|
'bookCase' => $bookCase,
|
|
]),
|
|
'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')
|
|
),
|
|
]);
|
|
}
|
|
}
|