Files
crewli/api/routes/api.php
bert.hausmans fda161ee09 chore: align migrations, docs, and frontends with crewli.app setup
- Replace dated migrations with ordered 2026_04_07_* chain; fold users update into base migration
- Update OrganisationScope, AppServiceProvider, seeders, api routes, and .env.example
- Refresh Cursor rules, CLAUDE.md, Makefile, README, and docs (API, SCHEMA, SETUP)
- Adjust admin/app/portal HTML, packages, api-client, events types, and theme config
- Update docker-compose and VS Code settings; remove stray Office lock files from resources

Made-with: Cursor
2026-04-07 10:45:34 +02:00

45 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
use App\Http\Controllers\Api\V1\EventController;
use App\Http\Controllers\Api\V1\LoginController;
use App\Http\Controllers\Api\V1\LogoutController;
use App\Http\Controllers\Api\V1\MeController;
use App\Http\Controllers\Api\V1\OrganisationController;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| All routes are automatically prefixed with /api/v1
|
*/
// Health check
Route::get('/', fn () => response()->json([
'success' => true,
'message' => 'Crewli API v1',
'timestamp' => now()->toIso8601String(),
]));
// Public auth routes
Route::post('auth/login', LoginController::class);
// Protected routes
Route::middleware('auth:sanctum')->group(function () {
// Auth
Route::get('auth/me', MeController::class);
Route::post('auth/logout', LogoutController::class);
// Organisations
Route::apiResource('organisations', OrganisationController::class)
->only(['index', 'show', 'store', 'update']);
// Events (nested under organisations)
Route::apiResource('organisations.events', EventController::class)
->only(['index', 'show', 'store', 'update']);
});