Skip to content

Commit

Permalink
refactor: route redirect links
Browse files Browse the repository at this point in the history
  • Loading branch information
alexevladgabriel committed Jan 6, 2025
1 parent e4849d8 commit 17bb23b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Middleware;

use App\Filament\App\Resources\ServerResource\Pages\ListServers;
use Illuminate\Http\Request;
use Illuminate\Auth\AuthManager;

Expand All @@ -18,7 +19,7 @@ public function __construct(private AuthManager $authManager) {}
public function handle(Request $request, \Closure $next, ?string $guard = null): mixed
{
if ($this->authManager->guard($guard)->check()) {
return redirect()->route('filament.app.resources...index');
return redirect(ListServers::getUrl());
}

return $next($request);
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function getConfiguration(): array
],
],
'allowed_mounts' => $this->mounts->pluck('source')->toArray(),
'remote' => route('filament.app.resources...index'),
'remote' => config('app.url'),
];
}

Expand Down
3 changes: 2 additions & 1 deletion app/Notifications/RemovedFromServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Notifications;

use App\Events\Server\SubUserRemoved;
use App\Filament\App\Resources\ServerResource\Pages\ListServers;
use App\Models\Server;
use App\Models\User;
use Illuminate\Bus\Queueable;
Expand Down Expand Up @@ -52,6 +53,6 @@ public function toMail(): MailMessage
->greeting('Hello ' . $this->user->username . '.')
->line('You have been removed as a subuser for the following server.')
->line('Server Name: ' . $this->server->name)
->action('Visit Panel', route('filament.app.resources...index'));
->action('Visit Panel', ListServers::getUrl());
}
}
3 changes: 2 additions & 1 deletion app/Notifications/ServerInstalled.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\Models\Server;
use Illuminate\Container\Container;
use App\Events\Server\Installed;
use App\Filament\App\Resources\ServerResource\Pages\ListServers;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Contracts\Notifications\Dispatcher;
Expand Down Expand Up @@ -63,6 +64,6 @@ public function toMail(): MailMessage
->greeting('Hello ' . $this->user->username . '.')
->line('Your server has finished installing and is now ready for you to use.')
->line('Server Name: ' . $this->server->name)
->action('Login and Begin Using', route('filament.app.resources...index'));
->action('Login and Begin Using', ListServers::getUrl());
}
}

0 comments on commit 17bb23b

Please sign in to comment.