Skip to content

Commit 61e7ba5

Browse files
authored
Add Edit Profile page (#276)
1 parent 2dbcacf commit 61e7ba5

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

resources/lang/en/navigation.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@
2727
'sponsor' => 'Sponsor Cachet',
2828
],
2929
],
30+
'user' => [
31+
'items' => [
32+
'edit_profile' => 'Edit Profile',
33+
],
34+
],
3035
];

src/CachetDashboardServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Cachet;
44

5+
use Cachet\Filament\Pages\EditProfile;
56
use Cachet\Http\Middleware\SetAppLocale;
67
use Filament\Http\Middleware\Authenticate;
78
use Filament\Http\Middleware\DisableBladeIconComponents;
@@ -30,6 +31,7 @@ public function panel(Panel $panel): Panel
3031
->default()
3132
->login()
3233
->passwordReset()
34+
->profile(EditProfile::class)
3335
->brandLogo(fn () => view('cachet::filament.brand-logo'))
3436
->brandLogoHeight('2rem')
3537
->colors([

src/Filament/Pages/EditProfile.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace Cachet\Filament\Pages;
4+
5+
use Filament\Forms\Form;
6+
use Filament\Pages\Auth\EditProfile as BaseEditProfile;
7+
use Illuminate\Contracts\Support\Htmlable;
8+
9+
class EditProfile extends BaseEditProfile
10+
{
11+
public function getTitle(): string|Htmlable
12+
{
13+
return __('cachet::navigation.user.items.edit_profile');
14+
}
15+
16+
public static function isSimple(): bool
17+
{
18+
return false;
19+
}
20+
21+
public function form(Form $form): Form
22+
{
23+
return $form
24+
->schema([
25+
$this->getNameFormComponent(),
26+
$this->getEmailFormComponent(),
27+
$this->getPasswordFormComponent(),
28+
$this->getPasswordConfirmationFormComponent(),
29+
]);
30+
}
31+
}

0 commit comments

Comments
 (0)