Skip to content

Commit

Permalink
Merge pull request #6 from penzespeter/main
Browse files Browse the repository at this point in the history
Add option to customise page title and translate save message
  • Loading branch information
quintenbuis authored Apr 21, 2023
2 parents 4678b6f + d833f07 commit 502aef4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/filament-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
// Sidebar label
'label' => 'Settings',

// Page title
'title' => 'Settings',

// Path to the file to be used as storage
'path' => storage_path('app/settings.json'),
];
6 changes: 5 additions & 1 deletion src/Pages/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function submit(): void
)->put($key, $data);
}

$this->notify('success', 'Saved!');
$this->notify('success', trans('Saved!'));
}

protected static function getNavigationGroup(): ?string
Expand All @@ -58,6 +58,10 @@ protected static function getNavigationLabel(): string
return config('filament-settings.label');
}

public function getTitle(): string {
return config("filament-settings.title");
}

protected static function shouldRegisterNavigation(): bool
{
return auth()->user()?->canManageSettings() ?? true;
Expand Down

0 comments on commit 502aef4

Please sign in to comment.