Deploy Ladill Servers / deploy (push) Successful in 22s
Wallet balance peek rendered as a menu row directly under Billing, backed by a /wallet/balance endpoint (BillingClient) and guarded by Route::has. Also opens Afia via a direct window event for reliability. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
85 lines
6.1 KiB
PHP
85 lines
6.1 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\Auth\SsoLoginController;
|
|
use App\Http\Controllers\WalletBalanceController;
|
|
use App\Http\Controllers\Hosting\AccountController;
|
|
use App\Http\Controllers\Hosting\AfiaController;
|
|
use App\Http\Controllers\Hosting\DeveloperController;
|
|
use App\Http\Controllers\Hosting\HostingProductController;
|
|
use App\Http\Controllers\Hosting\OverviewController;
|
|
use App\Http\Controllers\Hosting\SearchController;
|
|
use App\Http\Controllers\Hosting\ServerPanelController;
|
|
use App\Http\Controllers\Hosting\TeamController;
|
|
use App\Http\Controllers\NotificationController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
Route::get('/', fn () => auth()->check()
|
|
? redirect()->route('servers.dashboard')
|
|
: redirect()->route('sso.connect'))->name('servers.root');
|
|
|
|
// Ladill Servers — VPS & dedicated servers (servers.ladill.com).
|
|
|
|
|
|
Route::get('/login', [SsoLoginController::class, 'connect'])->name('login');
|
|
Route::get('/sso/connect', [SsoLoginController::class, 'connect'])->name('sso.connect');
|
|
Route::get('/sso/callback', [SsoLoginController::class, 'callback'])->name('sso.callback');
|
|
Route::post('/logout', [SsoLoginController::class, 'logout'])->name('logout');
|
|
Route::get('/sso/logout-bridge', [SsoLoginController::class, 'logoutBridge'])->name('sso.logout-bridge');
|
|
Route::get('/sso/logout-frontchannel', [SsoLoginController::class, 'frontchannelLogout'])->name('sso.logout-frontchannel');
|
|
Route::get('/sso/platform-signed-out', [SsoLoginController::class, 'platformSignedOut'])->name('sso.platform-signed-out');
|
|
Route::get('/signed-out', fn () => auth()->check() ? redirect()->route('servers.dashboard') : view('servers.signed-out'))->name('servers.signed-out');
|
|
|
|
Route::middleware(['auth', 'platform.session'])->group(function () {
|
|
Route::get('/wallet/balance', [WalletBalanceController::class, 'balance'])->name('wallet.balance');
|
|
Route::get('/notifications', [NotificationController::class, 'index'])->name('notifications.index');
|
|
Route::get('/notifications/unread', [NotificationController::class, 'unread'])->name('notifications.unread');
|
|
Route::post('/notifications/{id}/read', [NotificationController::class, 'markAsRead'])->name('notifications.mark-read');
|
|
Route::post('/notifications/mark-all-read', [NotificationController::class, 'markAllAsRead'])->name('notifications.mark-all-read');
|
|
|
|
Route::get('/search', SearchController::class)->name('servers.search');
|
|
Route::get('/domains/owned', \App\Http\Controllers\OwnedDomainsController::class)->name('servers.domains.owned');
|
|
Route::get('/dashboard', [OverviewController::class, 'index'])->name('servers.dashboard');
|
|
|
|
Route::get('/vps', [HostingProductController::class, 'vps'])->name('servers.vps');
|
|
Route::get('/dedicated', [HostingProductController::class, 'dedicated'])->name('servers.dedicated');
|
|
|
|
Route::redirect('/hosting/vps', '/vps');
|
|
Route::redirect('/hosting/dedicated', '/dedicated');
|
|
Route::redirect('/hosting', '/dashboard');
|
|
|
|
Route::get('/orders/{order}', [HostingProductController::class, 'show'])->name('servers.orders.show')->where('order', '[0-9]+');
|
|
Route::get('/hosting/orders/{order}', fn (int $order) => redirect()->route('servers.orders.show', $order))->where('order', '[0-9]+');
|
|
|
|
Route::post('/orders', [HostingProductController::class, 'storeServer'])->name('servers.orders.store');
|
|
Route::post('/hosting/orders', [HostingProductController::class, 'storeServer'])->name('hosting.servers.store');
|
|
Route::post('/orders/{order}/cancel', [HostingProductController::class, 'cancel'])->name('servers.orders.cancel')->where('order', '[0-9]+');
|
|
Route::post('/hosting/orders/{order}/cancel', [HostingProductController::class, 'cancel'])->name('hosting.orders.cancel')->where('order', '[0-9]+');
|
|
|
|
Route::prefix('orders/{order}/panel')->where(['order' => '[0-9]+'])->group(function () {
|
|
Route::get('/', [ServerPanelController::class, 'show'])->name('hosting.server-panel.show');
|
|
Route::get('/{path}', [ServerPanelController::class, 'show'])->where('path', '.*')->name('hosting.server-panel.show.path');
|
|
Route::post('/sync', [ServerPanelController::class, 'sync'])->name('hosting.server-panel.sync');
|
|
Route::post('/power/{action}', [ServerPanelController::class, 'power'])->whereIn('action', ['start', 'stop', 'reboot'])->name('hosting.server-panel.power');
|
|
Route::post('/tasks/domain', [ServerPanelController::class, 'queueDomain'])->name('hosting.server-panel.tasks.domain');
|
|
Route::post('/tasks/database', [ServerPanelController::class, 'queueDatabase'])->name('hosting.server-panel.tasks.database');
|
|
Route::post('/tasks/ssl', [ServerPanelController::class, 'queueSsl'])->name('hosting.server-panel.tasks.ssl');
|
|
Route::post('/tasks/file', [ServerPanelController::class, 'queueFile'])->name('hosting.server-panel.tasks.file');
|
|
Route::post('/tasks/php', [ServerPanelController::class, 'queuePhp'])->name('hosting.server-panel.tasks.php');
|
|
Route::post('/tasks/site-delete', [ServerPanelController::class, 'queueSiteDelete'])->name('hosting.server-panel.tasks.site-delete');
|
|
Route::post('/tasks/cron', [ServerPanelController::class, 'queueCron'])->name('hosting.server-panel.tasks.cron');
|
|
Route::post('/tasks/log', [ServerPanelController::class, 'queueLog'])->name('hosting.server-panel.tasks.log');
|
|
});
|
|
|
|
// Wallet, Billing, Team and Developers now live on the central hub
|
|
// (account.ladill.com). App-specific Settings + the acting-account switcher
|
|
// remain here.
|
|
Route::get('/account/wallet', fn () => redirect()->away(ladill_account_url('/wallet')))->name('account.wallet');
|
|
Route::get('/account/billing', fn () => redirect()->away(ladill_account_url('/billing')))->name('account.billing');
|
|
Route::get('/account/settings', [AccountController::class, 'settings'])->name('account.settings');
|
|
Route::put('/account/settings', [AccountController::class, 'updateSettings'])->name('account.settings.update');
|
|
|
|
Route::post('/account/switch', [TeamController::class, 'switchAccount'])->name('account.switch');
|
|
|
|
Route::post('/afia/chat', [AfiaController::class, 'chat'])->name('servers.afia.chat');
|
|
});
|