|
48 | 48 | Route::middleware('auth:sanctum')->group(function () { |
49 | 49 | // Auth |
50 | 50 | Route::post('/auth/logout', [AuthController::class, 'logout'])->name('auth.logout'); |
51 | | - Route::post('/auth/2fa/verify', [AuthController::class, 'verify2fa'])->name('auth.2fa.verify'); |
| 51 | + Route::middleware('abilities:2fa:pending') |
| 52 | + ->post('/auth/2fa/verify', [AuthController::class, 'verify2fa']) |
| 53 | + ->name('auth.2fa.verify'); |
52 | 54 |
|
53 | | - // Profile |
54 | | - Route::prefix('profile')->name('profile.')->group(function () { |
55 | | - Route::get('/', [ProfileController::class, 'show'])->name('show'); |
56 | | - Route::put('/', [ProfileController::class, 'update'])->name('update'); |
57 | | - Route::put('/password', [ProfileController::class, 'password'])->name('password'); |
58 | | - Route::get('/2fa/setup', [ProfileController::class, 'setup2fa'])->name('2fa.setup'); |
59 | | - Route::post('/2fa', [ProfileController::class, 'toggle2fa'])->name('2fa'); |
60 | | - Route::get('/2fa/recovery-codes', [ProfileController::class, 'recoveryCodes'])->name('2fa.recovery-codes'); |
61 | | - Route::post('/security-question', [ProfileController::class, 'saveSecurityQuestion'])->name('security-question'); |
62 | | - Route::delete('/', [ProfileController::class, 'deleteAccount'])->name('delete'); |
63 | | - }); |
| 55 | + Route::middleware('abilities:*')->group(function () { |
| 56 | + // Profile |
| 57 | + Route::prefix('profile')->name('profile.')->group(function () { |
| 58 | + Route::get('/', [ProfileController::class, 'show'])->name('show'); |
| 59 | + Route::put('/', [ProfileController::class, 'update'])->name('update'); |
| 60 | + Route::put('/password', [ProfileController::class, 'password'])->name('password'); |
| 61 | + Route::get('/2fa/setup', [ProfileController::class, 'setup2fa'])->name('2fa.setup'); |
| 62 | + Route::post('/2fa', [ProfileController::class, 'toggle2fa'])->name('2fa'); |
| 63 | + Route::get('/2fa/recovery-codes', [ProfileController::class, 'recoveryCodes'])->name('2fa.recovery-codes'); |
| 64 | + Route::post('/security-question', [ProfileController::class, 'saveSecurityQuestion'])->name('security-question'); |
| 65 | + Route::delete('/', [ProfileController::class, 'deleteAccount'])->name('delete'); |
| 66 | + }); |
64 | 67 |
|
65 | | - // Tickets |
66 | | - Route::prefix('tickets')->name('tickets.')->group(function () { |
67 | | - Route::get('/', [TicketController::class, 'index'])->name('index'); |
68 | | - Route::post('/', [TicketController::class, 'store'])->name('store'); |
69 | | - Route::get('/departments', [TicketController::class, 'departments'])->name('departments'); |
70 | | - Route::get('/{ticket}', [TicketController::class, 'show'])->name('show'); |
71 | | - Route::post('/{ticket}/reply', [TicketController::class, 'reply'])->name('reply'); |
72 | | - Route::post('/{ticket}/close', [TicketController::class, 'close'])->name('close'); |
73 | | - Route::post('/{ticket}/reopen', [TicketController::class, 'reopen'])->name('reopen'); |
74 | | - Route::get('/{ticket}/attachments/{attachment}', [TicketController::class, 'downloadAttachment'])->name('attachment'); |
75 | | - }); |
| 68 | + // Tickets |
| 69 | + Route::prefix('tickets')->name('tickets.')->group(function () { |
| 70 | + Route::get('/', [TicketController::class, 'index'])->name('index'); |
| 71 | + Route::post('/', [TicketController::class, 'store'])->name('store'); |
| 72 | + Route::get('/departments', [TicketController::class, 'departments'])->name('departments'); |
| 73 | + Route::get('/{ticket}', [TicketController::class, 'show'])->name('show'); |
| 74 | + Route::post('/{ticket}/reply', [TicketController::class, 'reply'])->name('reply'); |
| 75 | + Route::post('/{ticket}/close', [TicketController::class, 'close'])->name('close'); |
| 76 | + Route::post('/{ticket}/reopen', [TicketController::class, 'reopen'])->name('reopen'); |
| 77 | + Route::get('/{ticket}/attachments/{attachment}', [TicketController::class, 'downloadAttachment'])->name('attachment'); |
| 78 | + }); |
76 | 79 |
|
77 | | - // Invoices |
78 | | - Route::prefix('invoices')->name('invoices.')->group(function () { |
79 | | - Route::get('/', [InvoiceController::class, 'index'])->name('index'); |
80 | | - Route::get('/{invoice}', [InvoiceController::class, 'show'])->name('show'); |
81 | | - Route::get('/{invoice}/pdf', [InvoiceController::class, 'pdf'])->name('pdf'); |
82 | | - Route::get('/{invoice}/download', [InvoiceController::class, 'download'])->name('download'); |
83 | | - Route::post('/{invoice}/pay/{gateway}', [InvoiceController::class, 'pay'])->name('pay'); |
84 | | - Route::post('/{invoice}/balance', [InvoiceController::class, 'balance'])->name('balance'); |
85 | | - }); |
| 80 | + // Invoices |
| 81 | + Route::prefix('invoices')->name('invoices.')->group(function () { |
| 82 | + Route::get('/', [InvoiceController::class, 'index'])->name('index'); |
| 83 | + Route::get('/{invoice}', [InvoiceController::class, 'show'])->name('show'); |
| 84 | + Route::get('/{invoice}/pdf', [InvoiceController::class, 'pdf'])->name('pdf'); |
| 85 | + Route::get('/{invoice}/download', [InvoiceController::class, 'download'])->name('download'); |
| 86 | + Route::post('/{invoice}/pay/{gateway}', [InvoiceController::class, 'pay'])->name('pay'); |
| 87 | + Route::post('/{invoice}/balance', [InvoiceController::class, 'balance'])->name('balance'); |
| 88 | + }); |
86 | 89 |
|
87 | | - // Services |
88 | | - Route::prefix('services')->name('services.')->group(function () { |
89 | | - Route::get('/', [ServiceController::class, 'index'])->name('index'); |
90 | | - Route::get('/{service}', [ServiceController::class, 'show'])->name('show'); |
91 | | - }); |
| 90 | + // Services |
| 91 | + Route::prefix('services')->name('services.')->group(function () { |
| 92 | + Route::get('/', [ServiceController::class, 'index'])->name('index'); |
| 93 | + Route::get('/{service}', [ServiceController::class, 'show'])->name('show'); |
| 94 | + }); |
92 | 95 |
|
93 | | - // Payment Methods |
94 | | - Route::prefix('payment-methods')->name('payment-methods.')->group(function () { |
95 | | - Route::get('/', [PaymentMethodController::class, 'index'])->name('index'); |
96 | | - Route::get('/gateways', [PaymentMethodController::class, 'gateways'])->name('gateways'); |
97 | | - Route::post('/{gateway}', [PaymentMethodController::class, 'add'])->name('add'); |
98 | | - Route::put('/{source}/default', [PaymentMethodController::class, 'setDefault'])->name('default'); |
99 | | - Route::delete('/{source}', [PaymentMethodController::class, 'delete'])->name('delete'); |
| 96 | + // Payment Methods |
| 97 | + Route::prefix('payment-methods')->name('payment-methods.')->group(function () { |
| 98 | + Route::get('/', [PaymentMethodController::class, 'index'])->name('index'); |
| 99 | + Route::get('/gateways', [PaymentMethodController::class, 'gateways'])->name('gateways'); |
| 100 | + Route::post('/{gateway}', [PaymentMethodController::class, 'add'])->name('add'); |
| 101 | + Route::put('/{source}/default', [PaymentMethodController::class, 'setDefault'])->name('default'); |
| 102 | + Route::delete('/{source}', [PaymentMethodController::class, 'delete'])->name('delete'); |
| 103 | + }); |
100 | 104 | }); |
101 | 105 | }); |
0 commit comments