You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.3KB

  1. <?php
  2. use App\Codes\UserRole;
  3. use App\Util\RouteHelper;
  4. use Illuminate\Support\Facades\Route;
  5. /*
  6. |--------------------------------------------------------------------------
  7. | API Routes
  8. |--------------------------------------------------------------------------
  9. |
  10. | Here is where you can register API routes for your application. These
  11. | routes are loaded by the RouteServiceProvider and all of them will
  12. | be assigned to the "api" middleware group. Make something great!
  13. |
  14. */
  15. RouteHelper::post('/login', App\Http\Controllers\Web\Auth\LoginController::class);
  16. RouteHelper::get('/me', App\Http\Controllers\Web\Auth\MeController::class);
  17. RouteHelper::get('/logout', App\Http\Controllers\Web\Auth\LogoutController::class);
  18. RouteHelper::get('/qr-service/get-ticket', App\Http\Controllers\Web\QRService\CreateTicketController::class);
  19. Route::middleware('auth:sanctum')->group(function () {
  20. Route::middleware(RouteHelper::role([UserRole::ADMIN]))->group(function () {
  21. });
  22. Route::middleware(RouteHelper::role([UserRole::ADMIN, UserRole::CUSTOMER]))->group(function () {
  23. RouteHelper::post('/role/switch', App\Http\Controllers\Web\Auth\SwitchController::class);
  24. RouteHelper::get('/role/switch/end', App\Http\Controllers\Web\Auth\SwitchEndController::class);
  25. });
  26. });