2025-11-21 15:00:30 +09:00
|
|
|
<?php
|
|
|
|
|
|
2025-11-24 16:36:02 +09:00
|
|
|
use App\Http\Controllers\Api\Admin\RoleController;
|
2025-11-21 15:00:30 +09:00
|
|
|
use App\Http\Controllers\Api\Admin\TenantController;
|
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| API Routes
|
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
| HTMX 요청 시 HTML 반환, 일반 요청 시 JSON 반환
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
2025-11-24 11:17:31 +09:00
|
|
|
Route::middleware(['web', 'auth'])->prefix('admin')->name('api.admin.')->group(function () {
|
2025-11-21 15:00:30 +09:00
|
|
|
|
|
|
|
|
// 테넌트 관리 API
|
|
|
|
|
Route::prefix('tenants')->name('tenants.')->group(function () {
|
2025-11-24 11:17:31 +09:00
|
|
|
// 고정 경로는 먼저 정의
|
|
|
|
|
Route::get('/stats', [TenantController::class, 'stats'])->name('stats');
|
|
|
|
|
|
|
|
|
|
// 동적 경로는 나중에 정의
|
2025-11-21 15:00:30 +09:00
|
|
|
Route::get('/', [TenantController::class, 'index'])->name('index');
|
|
|
|
|
Route::post('/', [TenantController::class, 'store'])->name('store');
|
|
|
|
|
Route::get('/{id}', [TenantController::class, 'show'])->name('show');
|
|
|
|
|
Route::put('/{id}', [TenantController::class, 'update'])->name('update');
|
|
|
|
|
Route::delete('/{id}', [TenantController::class, 'destroy'])->name('destroy');
|
|
|
|
|
|
|
|
|
|
// 추가 액션
|
|
|
|
|
Route::post('/{id}/restore', [TenantController::class, 'restore'])->name('restore');
|
|
|
|
|
Route::delete('/{id}/force', [TenantController::class, 'forceDestroy'])->name('forceDestroy');
|
|
|
|
|
});
|
2025-11-24 16:36:02 +09:00
|
|
|
|
|
|
|
|
// 역할 관리 API
|
|
|
|
|
Route::prefix('roles')->name('roles.')->group(function () {
|
|
|
|
|
Route::get('/', [RoleController::class, 'index'])->name('index');
|
|
|
|
|
Route::post('/', [RoleController::class, 'store'])->name('store');
|
|
|
|
|
Route::get('/{id}', [RoleController::class, 'show'])->name('show');
|
|
|
|
|
Route::put('/{id}', [RoleController::class, 'update'])->name('update');
|
|
|
|
|
Route::delete('/{id}', [RoleController::class, 'destroy'])->name('destroy');
|
|
|
|
|
});
|
2025-11-21 15:00:30 +09:00
|
|
|
});
|