- Laravel 11.51 + PHP 8.4 in backend/
- MySQL 9 connection (DBngin, db: verde)
- Installed Sanctum, Spatie permission/activitylog/model-states,
matanyadaev/laravel-eloquent-spatial
- API routes prefixed /api/v1 in bootstrap/app.php
- Standard response envelope { success, data, message, errors, meta }
via ApiResponse + ApiController base class
- Global exception handlers for validation/auth/not-found/http errors
on api/* routes (always JSON, never redirect to login)
- Extended users migration: uuid, phone+verified_at, role enum
(admin/resident/driver/helper/scanner/store_partner), status,
first/middle/last name, avatar_path, preferred_language, fcm_token,
last_login_at, soft deletes
- User model: HasApiTokens, HasRoles, LogsActivity, SoftDeletes,
role/status constants, auto-uuid on create
- Health endpoint at GET /api/v1/health verifies DB connection
- backend/CLAUDE.md documenting backend conventions
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27 lines
804 B
PHP
27 lines
804 B
PHP
<?php
|
|
|
|
use App\Http\Controllers\Api\V1\HealthController;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| API Routes (v1)
|
|
|--------------------------------------------------------------------------
|
|
| All routes here are prefixed with /api/v1 (configured in bootstrap/app.php).
|
|
*/
|
|
|
|
Route::get('/health', HealthController::class)->name('api.v1.health');
|
|
|
|
Route::middleware('auth:sanctum')->group(function () {
|
|
Route::get('/me', function (Request $request) {
|
|
return response()->json([
|
|
'success' => true,
|
|
'data' => $request->user(),
|
|
'message' => null,
|
|
'errors' => null,
|
|
'meta' => (object) [],
|
|
]);
|
|
})->name('api.v1.me');
|
|
});
|