Files
ladill-pos/routes/web.php
T
isaaccladandCursor e5d2b84388
Deploy Ladill Mini / deploy (push) Successful in 23s
Add Ladill POS v1 — register, Pay checkout, and commerce links.
Staff-facing counter register at pos.ladill.com with catalog cart, cash and
MoMo/card checkout via Ladill Pay, CRM timeline/import, invoice prefill, and
Merchant catalog import.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 22:52:24 +00:00

58 lines
3.7 KiB
PHP

<?php
use App\Http\Controllers\Auth\SsoLoginController;
use App\Http\Controllers\Pos\DashboardController;
use App\Http\Controllers\Pos\ProductController;
use App\Http\Controllers\Pos\RegisterController;
use App\Http\Controllers\Pos\SaleController;
use App\Http\Controllers\Pos\SettingsController;
use App\Http\Controllers\NotificationController;
use App\Http\Controllers\WalletBalanceController;
use Illuminate\Support\Facades\Route;
Route::get('/', fn () => auth()->check()
? redirect()->route('pos.dashboard')
: redirect()->route('sso.connect'))->name('pos.root');
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('pos.dashboard') : view('auth.signed-out'))->name('pos.signed-out');
Route::get('/sales/{sale}/callback', [SaleController::class, 'callback'])->name('pos.sales.callback');
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('/dashboard', [DashboardController::class, 'index'])->name('pos.dashboard');
Route::get('/register', [RegisterController::class, 'index'])->name('pos.register');
Route::post('/register/charge', [RegisterController::class, 'charge'])->name('pos.register.charge');
Route::get('/sales', [SaleController::class, 'index'])->name('pos.sales.index');
Route::get('/sales/{sale}', [SaleController::class, 'show'])->name('pos.sales.show');
Route::get('/products', [ProductController::class, 'index'])->name('pos.products.index');
Route::get('/products/create', [ProductController::class, 'create'])->name('pos.products.create');
Route::post('/products', [ProductController::class, 'store'])->name('pos.products.store');
Route::get('/products/{product}/edit', [ProductController::class, 'edit'])->name('pos.products.edit');
Route::put('/products/{product}', [ProductController::class, 'update'])->name('pos.products.update');
Route::delete('/products/{product}', [ProductController::class, 'destroy'])->name('pos.products.destroy');
Route::get('/settings', [SettingsController::class, 'index'])->name('pos.settings');
Route::put('/settings', [SettingsController::class, 'update'])->name('pos.settings.update');
Route::post('/settings/import-crm', [SettingsController::class, 'importCrm'])->name('pos.settings.import-crm');
Route::post('/settings/import-merchant', [SettingsController::class, 'importMerchant'])->name('pos.settings.import-merchant');
Route::get('/wallet', fn () => redirect()->away(ladill_account_url('/wallet')))->name('pos.wallet');
});