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
@@ -12,31 +12,34 @@ class MeetupEventForm extends Component
|
||||
use Actions;
|
||||
|
||||
public string $country;
|
||||
|
||||
public ?MeetupEvent $meetupEvent = null;
|
||||
|
||||
public bool $recurring = false;
|
||||
|
||||
public int $repetitions = 52;
|
||||
|
||||
public array $series = [];
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'meetupEvent.meetup_id' => 'required',
|
||||
'meetupEvent.start' => 'required',
|
||||
'meetupEvent.location' => 'string|nullable',
|
||||
'meetupEvent.meetup_id' => 'required',
|
||||
'meetupEvent.start' => 'required',
|
||||
'meetupEvent.location' => 'string|nullable',
|
||||
'meetupEvent.description' => 'string|nullable',
|
||||
'meetupEvent.link' => 'string|url|nullable',
|
||||
'meetupEvent.link' => 'string|url|nullable',
|
||||
|
||||
'series.*.start' => 'required',
|
||||
|
||||
'recurring' => 'bool',
|
||||
'recurring' => 'bool',
|
||||
'repetitions' => 'numeric|min:1',
|
||||
];
|
||||
}
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if (!$this->meetupEvent) {
|
||||
if (! $this->meetupEvent) {
|
||||
$this->meetupEvent = new MeetupEvent(
|
||||
[
|
||||
'start' => now()
|
||||
@@ -44,7 +47,7 @@ class MeetupEventForm extends Component
|
||||
->addHours(17),
|
||||
]
|
||||
);
|
||||
} elseif (!auth()
|
||||
} elseif (! auth()
|
||||
->user()
|
||||
->can('update', $this->meetupEvent)) {
|
||||
abort(403);
|
||||
@@ -86,15 +89,15 @@ class MeetupEventForm extends Component
|
||||
$this->dialog()
|
||||
->confirm(
|
||||
[
|
||||
'title' => __('Delete event'),
|
||||
'title' => __('Delete event'),
|
||||
'description' => __('Are you sure you want to delete this event? This action cannot be undone.'),
|
||||
'icon' => 'warning',
|
||||
'accept' => [
|
||||
'label' => __('Yes, delete'),
|
||||
'icon' => 'warning',
|
||||
'accept' => [
|
||||
'label' => __('Yes, delete'),
|
||||
'method' => 'deleteEvent',
|
||||
],
|
||||
'reject' => [
|
||||
'label' => __('No, cancel'),
|
||||
'reject' => [
|
||||
'label' => __('No, cancel'),
|
||||
'method' => 'cancel',
|
||||
],
|
||||
]
|
||||
@@ -111,7 +114,7 @@ class MeetupEventForm extends Component
|
||||
public function submit()
|
||||
{
|
||||
$this->validate();
|
||||
if (!$this->meetupEvent->id) {
|
||||
if (! $this->meetupEvent->id) {
|
||||
$hasAppointmentsOnThisDate = MeetupEvent::query()
|
||||
->where('meetup_id', $this->meetupEvent->meetup_id)
|
||||
->where('start', '>', Carbon::parse($this->meetupEvent->start)
|
||||
@@ -129,7 +132,7 @@ class MeetupEventForm extends Component
|
||||
|
||||
$this->meetupEvent->save();
|
||||
|
||||
if (!$this->meetupEvent->id && $this->recurring) {
|
||||
if (! $this->meetupEvent->id && $this->recurring) {
|
||||
foreach ($this->series as $event) {
|
||||
$hasAppointmentsOnThisDate = MeetupEvent::query()
|
||||
->where('meetup_id', $this->meetupEvent->meetup_id)
|
||||
|
||||
Reference in New Issue
Block a user