Files
ladill-mini/routes/web.php
T
isaaccladandCursor f52e3e882e
Deploy Ladill Mini / deploy (push) Successful in 33s
Add delete for Mini payment QRs.
Vendors can remove a payment QR from the show page; stored images are cleaned up and the short link stops resolving.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 20:49:15 +00:00

61 lines
4.1 KiB
PHP

<?php
use App\Http\Controllers\Auth\SsoLoginController;
use App\Http\Controllers\Mini\OverviewController;
use App\Http\Controllers\Mini\PaymentQrController;
use App\Http\Controllers\Mini\PaymentsController;
use App\Http\Controllers\Mini\PayoutsController;
use App\Http\Controllers\NotificationController;
use App\Http\Controllers\Public\PaymentController;
use App\Http\Controllers\Public\QrScanController;
use App\Http\Controllers\Qr\AccountController;
use App\Http\Controllers\Qr\AfiaController;
use App\Http\Controllers\Qr\TeamController;
use Illuminate\Support\Facades\Route;
Route::get('/', fn () => auth()->check()
? redirect()->route('mini.dashboard')
: redirect()->route('sso.connect'))->name('mini.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-frontchannel', [SsoLoginController::class, 'frontchannelLogout'])->name('sso.logout-frontchannel');
Route::get('/signed-out', fn () => auth()->check() ? redirect()->route('mini.dashboard') : view('mini.signed-out'))->name('mini.signed-out');
Route::get('/q/{shortCode}', [QrScanController::class, 'resolve'])->name('qr.public.resolve');
Route::get('/q/{shortCode}/payment-logo', [QrScanController::class, 'paymentLogo'])->name('qr.public.payment.logo');
Route::post('/q/{shortCode}/pay', [PaymentController::class, 'pay'])->name('qr.public.payment.pay');
Route::get('/q/{shortCode}/pay/callback', [PaymentController::class, 'callback'])->name('qr.public.payment.callback');
Route::middleware(['auth'])->group(function () {
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', [OverviewController::class, 'index'])->name('mini.dashboard');
Route::post('/afia/chat', [AfiaController::class, 'chat'])->name('mini.afia.chat');
Route::get('/payment-qrs', [PaymentQrController::class, 'index'])->name('mini.payment-qrs.index');
Route::get('/payment-qrs/create', [PaymentQrController::class, 'create'])->name('mini.payment-qrs.create');
Route::post('/payment-qrs', [PaymentQrController::class, 'store'])->name('mini.payment-qrs.store');
Route::get('/payment-qrs/{paymentQr}', [PaymentQrController::class, 'show'])->name('mini.payment-qrs.show');
Route::patch('/payment-qrs/{paymentQr}', [PaymentQrController::class, 'update'])->name('mini.payment-qrs.update');
Route::delete('/payment-qrs/{paymentQr}', [PaymentQrController::class, 'destroy'])->name('mini.payment-qrs.destroy');
Route::get('/payment-qrs/{paymentQr}/preview.png', [PaymentQrController::class, 'preview'])->name('mini.payment-qrs.preview');
Route::get('/payment-qrs/{paymentQr}/download/{format}', [PaymentQrController::class, 'download'])->name('mini.payment-qrs.download')->whereIn('format', ['png', 'svg', 'pdf']);
Route::get('/payments', [PaymentsController::class, 'index'])->name('mini.payments.index');
Route::get('/payouts', [PayoutsController::class, 'index'])->name('mini.payouts');
Route::get('/settings', [AccountController::class, 'settings'])->name('account.settings');
Route::put('/settings', [AccountController::class, 'updateSettings'])->name('account.settings.update');
Route::get('/team', [TeamController::class, 'index'])->name('account.team');
Route::post('/team', [TeamController::class, 'store'])->name('account.team.store');
Route::delete('/team/{member}', [TeamController::class, 'destroy'])->name('account.team.destroy');
Route::post('/switch-account', [TeamController::class, 'switchAccount'])->name('account.switch');
});