refactor: route redirect links

This commit is contained in:
Scai 2025-01-06 19:58:32 +02:00
parent e4849d89d7
commit 17bb23b5b8
4 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,7 @@
namespace App\Http\Middleware;
use App\Filament\App\Resources\ServerResource\Pages\ListServers;
use Illuminate\Http\Request;
use Illuminate\Auth\AuthManager;
@ -18,7 +19,7 @@ class RedirectIfAuthenticated
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);

View File

@ -201,7 +201,7 @@ class Node extends Model
],
],
'allowed_mounts' => $this->mounts->pluck('source')->toArray(),
'remote' => route('filament.app.resources...index'),
'remote' => config('app.url'),
];
}

View File

@ -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;
@ -52,6 +53,6 @@ class RemovedFromServer extends Notification implements ShouldQueue
->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());
}
}

View File

@ -7,6 +7,7 @@ use Illuminate\Bus\Queueable;
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;
@ -63,6 +64,6 @@ class ServerInstalled extends Notification implements ShouldQueue
->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());
}
}