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).
49 lines
1.7 KiB
PHP
49 lines
1.7 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 BookCaseTable extends Component
|
|
{
|
|
public ?Country $country = null;
|
|
|
|
public string $c = 'de';
|
|
|
|
public array $bookcases = [];
|
|
|
|
protected $queryString = ['bookcases'];
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.book-case.book-case-table', [
|
|
'markers' => ! isset($this->table['filters']['byids']) ? []
|
|
: BookCase::query()
|
|
->whereIn('id', str($this->table['filters']['byids'] ?? '')->explode(','))
|
|
->get()
|
|
->map(fn ($b) => [
|
|
'title' => $b->title,
|
|
'lat' => $b->latitude,
|
|
'lng' => $b->longitude,
|
|
'url' => route('bookCases.comment.bookcase', ['country' => $this->country, 'bookCase' => $b]),
|
|
'icon' => asset('img/btc-logo-6219386_1280.png'),
|
|
'icon_size' => [42, 42],
|
|
])
|
|
->toArray(),
|
|
'bookCases' => BookCase::query()->active()->get(),
|
|
'countries' => Country::query()
|
|
->select(['code', 'name'])
|
|
->get(),
|
|
])->layout('layouts.app', [
|
|
'SEOData' => new SEOData(
|
|
title: __('Bookcases'),
|
|
description: __('Search out a public bookcase'),
|
|
image: asset('img/screenshot.png')
|
|
),
|
|
]);
|
|
}
|
|
}
|