mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
Apply Laravel coding style
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).
This commit is contained in:
committed by
HolgerHatGarKeineNode
parent
a15ca4a2bc
commit
5776b01d15
@@ -10,7 +10,9 @@ use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||
class BookCaseTable extends Component
|
||||
{
|
||||
public ?Country $country = null;
|
||||
|
||||
public string $c = 'de';
|
||||
|
||||
public array $bookcases = [];
|
||||
|
||||
protected $queryString = ['bookcases'];
|
||||
@@ -18,16 +20,16 @@ class BookCaseTable extends Component
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.book-case.book-case-table', [
|
||||
'markers' => !isset($this->table['filters']['byids']) ? []
|
||||
'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'),
|
||||
->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(),
|
||||
@@ -40,7 +42,7 @@ class BookCaseTable extends Component
|
||||
title: __('Bookcases'),
|
||||
description: __('Search out a public bookcase'),
|
||||
image: asset('img/screenshot.png')
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class CityTable extends Component
|
||||
title: __('Bookcases'),
|
||||
description: __('Search out a public bookcase'),
|
||||
image: asset('img/screenshot.png')
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@ class CommentBookCase extends Component
|
||||
|
||||
public BookCase $bookCase;
|
||||
|
||||
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.book-case.comment-book-case')
|
||||
@@ -31,7 +29,7 @@ class CommentBookCase extends Component
|
||||
title: $this->bookCase->title,
|
||||
description: $this->bookCase->address,
|
||||
image: $this->bookCase->getFirstMediaUrl('images') ?? asset('img/bookcase.jpg'),
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -43,7 +41,7 @@ class CommentBookCase extends Component
|
||||
|
||||
$this->bookCase
|
||||
->addMedia($this->photo)
|
||||
->usingFileName(md5($this->photo->getClientOriginalName()) . '.' . $this->photo->getClientOriginalExtension())
|
||||
->usingFileName(md5($this->photo->getClientOriginalName()).'.'.$this->photo->getClientOriginalExtension())
|
||||
->toMediaCollection('images');
|
||||
|
||||
return to_route('bookCases.comment.bookcase', ['country' => $this->country, 'bookCase' => $this->bookCase->id]);
|
||||
@@ -62,7 +60,7 @@ class CommentBookCase extends Component
|
||||
if (str($url)->contains('http')) {
|
||||
return $url;
|
||||
}
|
||||
if (!str($url)->contains('http')) {
|
||||
if (! str($url)->contains('http')) {
|
||||
return str($url)->prepend('https://');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ class OrangePillForm extends Component
|
||||
public Country $country;
|
||||
|
||||
public BookCase $bookCase;
|
||||
|
||||
public ?OrangePill $orangePill = null;
|
||||
|
||||
public $image;
|
||||
@@ -27,22 +28,22 @@ class OrangePillForm extends Component
|
||||
{
|
||||
return [
|
||||
'orangePill.book_case_id' => 'required',
|
||||
'orangePill.user_id' => 'required',
|
||||
'orangePill.amount' => 'required|numeric',
|
||||
'orangePill.date' => 'required|date',
|
||||
'orangePill.comment' => 'required|string',
|
||||
'image' => 'image|max:8192', // 8MB Max
|
||||
'orangePill.user_id' => 'required',
|
||||
'orangePill.amount' => 'required|numeric',
|
||||
'orangePill.date' => 'required|date',
|
||||
'orangePill.comment' => 'required|string',
|
||||
'image' => 'image|max:8192', // 8MB Max
|
||||
];
|
||||
}
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if (!$this->orangePill) {
|
||||
if (! $this->orangePill) {
|
||||
$this->orangePill = new OrangePill([
|
||||
'user_id' => auth()->id(),
|
||||
'user_id' => auth()->id(),
|
||||
'book_case_id' => $this->bookCase->id,
|
||||
'date' => now(),
|
||||
'amount' => 1,
|
||||
'date' => now(),
|
||||
'amount' => 1,
|
||||
]);
|
||||
} elseif ($this->orangePill->user_id !== auth()->id()) {
|
||||
abort(403);
|
||||
|
||||
@@ -16,7 +16,7 @@ class Heatmap extends Component
|
||||
->active()
|
||||
->whereHas('orangePills')
|
||||
->get()
|
||||
->map(fn($bookCase) => [
|
||||
->map(fn ($bookCase) => [
|
||||
'lat' => $bookCase->latitude,
|
||||
'lng' => $bookCase->longitude,
|
||||
]);
|
||||
@@ -28,7 +28,7 @@ class Heatmap extends Component
|
||||
title: __('Heatmap of Bookcases'),
|
||||
description: __('On this map you can see the success and spread of the Bitcoin books.'),
|
||||
image: asset('img/heatmap_bookcases.png'),
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@ use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||
class HighscoreTable extends Component
|
||||
{
|
||||
public Country $country;
|
||||
|
||||
public bool $viewingModal = false;
|
||||
|
||||
public ?User $modal = null;
|
||||
|
||||
public function render()
|
||||
@@ -31,7 +33,7 @@ class HighscoreTable extends Component
|
||||
title: __('Highscore Table'),
|
||||
description: __('Hall of fame of our honorable plebs'),
|
||||
image: asset('img/highscore_table_screenshot.png'),
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,15 +19,15 @@ class WorldMap extends Component
|
||||
->withCount('orangePills')
|
||||
->active()
|
||||
->get()
|
||||
->map(fn($bookCase) => [
|
||||
->map(fn ($bookCase) => [
|
||||
'lat' => $bookCase->latitude,
|
||||
'lng' => $bookCase->longitude,
|
||||
'url' => url()->route('bookCases.comment.bookcase',
|
||||
[
|
||||
'country' => $this->country,
|
||||
'country' => $this->country,
|
||||
'bookCase' => $bookCase,
|
||||
]),
|
||||
'op' => $bookCase->orange_pills_count,
|
||||
'op' => $bookCase->orange_pills_count,
|
||||
])
|
||||
->toArray(),
|
||||
])->layout('layouts.app', [
|
||||
@@ -35,7 +35,7 @@ class WorldMap extends Component
|
||||
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')
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user