Files
ladill-mini/routes/api.php
T
isaaccladandClaude Opus 4.8 cd56771b59
Deploy Ladill Mini / deploy (push) Successful in 31s
Mobile auth: native login + register via central identity API.
Login no longer uses the OAuth password grant (which wasn't enabled, the cause
of login failures). Both login and the new register endpoint proxy to
auth.ladill.com /api/identity/auth/* (shared IDENTITY_API_KEY_MINI), provision
the local mirror, and issue a Sanctum token — one Ladill identity across web
and app.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 23:04:04 +00:00

41 lines
2.8 KiB
PHP

<?php
use App\Http\Controllers\Api\AuthController;
use App\Http\Controllers\Api\MeController;
use App\Http\Controllers\Api\Mini\OverviewController as MiniOverviewController;
use App\Http\Controllers\Api\Mini\PaymentQrController as MiniPaymentQrController;
use App\Http\Controllers\Api\Mini\PaymentsController as MiniPaymentsController;
use App\Http\Controllers\Api\Mini\PayoutsController as MiniPayoutsController;
use App\Http\Controllers\Api\QrCodeController;
use Illuminate\Support\Facades\Route;
Route::prefix('v1')->group(function () {
// Mobile token auth (Ladill Mini Android). Public — proxies to the central
// Ladill identity API and issues a Sanctum token.
Route::post('/auth/login', [AuthController::class, 'login'])->middleware('throttle:10,1')->name('api.auth.login');
Route::post('/auth/register', [AuthController::class, 'register'])->middleware('throttle:10,1')->name('api.auth.register');
Route::middleware(['auth:sanctum', \App\Http\Middleware\SetActingAccount::class])->group(function () {
Route::post('/auth/logout', [AuthController::class, 'logout'])->name('api.auth.logout');
Route::get('/me', MeController::class);
Route::get('/qr-codes', [QrCodeController::class, 'index']);
Route::post('/qr-codes', [QrCodeController::class, 'store']);
Route::get('/qr-codes/{qrCode}', [QrCodeController::class, 'show'])->whereNumber('qrCode');
Route::patch('/qr-codes/{qrCode}', [QrCodeController::class, 'update'])->whereNumber('qrCode');
Route::get('/qr-codes/{qrCode}/analytics', [QrCodeController::class, 'analytics'])->whereNumber('qrCode');
// Ladill Mini — payments product.
Route::get('/mini/overview', MiniOverviewController::class)->name('api.mini.overview');
Route::get('/mini/payment-qrs', [MiniPaymentQrController::class, 'index'])->name('api.mini.payment-qrs.index');
Route::post('/mini/payment-qrs', [MiniPaymentQrController::class, 'store'])->name('api.mini.payment-qrs.store');
Route::get('/mini/payment-qrs/{paymentQr}', [MiniPaymentQrController::class, 'show'])->whereNumber('paymentQr')->name('api.mini.payment-qrs.show');
Route::patch('/mini/payment-qrs/{paymentQr}', [MiniPaymentQrController::class, 'update'])->whereNumber('paymentQr')->name('api.mini.payment-qrs.update');
Route::delete('/mini/payment-qrs/{paymentQr}', [MiniPaymentQrController::class, 'destroy'])->whereNumber('paymentQr')->name('api.mini.payment-qrs.destroy');
Route::get('/mini/payment-qrs/{paymentQr}/preview.png', [MiniPaymentQrController::class, 'preview'])->whereNumber('paymentQr')->name('api.mini.payment-qrs.preview');
Route::get('/mini/payments', [MiniPaymentsController::class, 'index'])->name('api.mini.payments.index');
Route::get('/mini/payouts', MiniPayoutsController::class)->name('api.mini.payouts');
});
});