Skip to content

Commit fd4032a

Browse files
scott graysonscott grayson
authored andcommitted
Improve naming clarity in PublicHelpArticleController
- Rename findFrontendPanel() → findAuthenticatedPanel() - Rename getFrontendHelpUrl() → getAuthenticatedHelpUrl() - Update all method calls and comments - Makes it clear these methods handle authenticated panel URLs
1 parent a8e629b commit fd4032a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Http/Controllers/PublicHelpArticleController.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
class PublicHelpArticleController
1313
{
1414
/**
15-
* Find the panel that has the frontend help resource registered.
15+
* Find the panel that has the authenticated help resource registered.
1616
*/
17-
protected function findFrontendPanel(): ?\Filament\Panel
17+
protected function findAuthenticatedPanel(): ?\Filament\Panel
1818
{
1919
foreach (Filament::getPanels() as $panel) {
2020
$resources = $panel->getResources();
@@ -29,11 +29,11 @@ protected function findFrontendPanel(): ?\Filament\Panel
2929
}
3030

3131
/**
32-
* Get the URL for the frontend help resource on the specified panel.
32+
* Get the URL for the authenticated help resource in the Filament panel.
3333
*/
34-
protected function getFrontendHelpUrl(string $name, array $parameters = []): ?string
34+
protected function getAuthenticatedHelpUrl(string $name, array $parameters = []): ?string
3535
{
36-
$panel = $this->findFrontendPanel();
36+
$panel = $this->findAuthenticatedPanel();
3737
if (! $panel) {
3838
return null;
3939
}
@@ -54,7 +54,7 @@ public function index()
5454
{
5555
// If user is authenticated, redirect to the authenticated help index
5656
if (Auth::check()) {
57-
$url = $this->getFrontendHelpUrl('index');
57+
$url = $this->getAuthenticatedHelpUrl('index');
5858
if ($url) {
5959
return redirect($url);
6060
}
@@ -85,7 +85,7 @@ public function show(string $slug)
8585

8686
// If user is authenticated, redirect to the authenticated help page
8787
if (Auth::check()) {
88-
$url = $this->getFrontendHelpUrl('view', ['record' => $article->slug]);
88+
$url = $this->getAuthenticatedHelpUrl('view', ['record' => $article->slug]);
8989
if ($url) {
9090
return redirect($url);
9191
}

0 commit comments

Comments
 (0)