Skip to content

Commit 2420faa

Browse files
wip
1 parent d8c477c commit 2420faa

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/Pages/Auth/EditProfile.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace Backstage\Users\Pages\Auth;
3+
namespace Backstage\Filament\Users\Pages\Auth;
44

5+
use Filament\Pages\Auth\EditProfile as BaseEditProfile;
6+
use Filament\Forms\Components\Select;
57
use Backstage\Filament\Users\Models\User;
68
use Backstage\Laravel\Users\Enums\NotificationType;
7-
use Filament\Forms\Components\Select;
8-
use Filament\Pages\Auth\EditProfile;
99

10-
class Profile extends EditProfile
10+
class EditProfile extends BaseEditProfile
1111
{
1212
protected function getForms(): array
1313
{
@@ -36,21 +36,21 @@ public static function getNotificationFormComponent(): Select
3636
$options = [];
3737

3838
foreach ($types as $type) {
39-
$options[$type->value] = $type->label();
39+
$options[$type->value] = $type->label();
4040
}
4141

4242
return Select::make('notification_preferences')
4343
->label(__('Notification preferences'))
44-
->options(fn () => $options)
44+
->options(fn() => $options)
4545
->live()
46-
->placeholder(fn () => ('Select notification preferences'))
46+
->placeholder(fn() => ('Select notification preferences'))
4747
->searchingMessage(__('Searching notification types...'))
4848
->searchPrompt(__('Search notification types...'))
4949
->saveRelationshipsUsing(function (User $record, array $state) {
50-
$state = collect($state)->map(fn ($value) => NotificationType::from($value));
50+
$state = collect($state)->map(fn($value) => NotificationType::from($value));
5151

5252
$state->each(function (NotificationType $type) use ($record) {
53-
if (! $record->notificationPreferences->contains('navigation_type', $type->value)) {
53+
if (!$record->notificationPreferences->contains('navigation_type', $type->value)) {
5454

5555
$record->notificationPreferences()->create([
5656
'navigation_type' => $type->value,
@@ -70,9 +70,9 @@ protected function mutateFormDataBeforeFill(array $data): array
7070
$user = $this->getUser();
7171

7272
if ($user->notificationPreferences->isNotEmpty()) {
73-
$data['notification_preferences'] = $user->notificationPreferences->pluck('navigation_type')->map(fn (NotificationType $record) => $record->value)->toArray();
73+
$data['notification_preferences'] = $user->notificationPreferences->pluck('navigation_type')->map(fn(NotificationType $record) => $record->value)->toArray();
7474
}
7575

7676
return $data;
7777
}
78-
}
78+
}

0 commit comments

Comments
 (0)