59 lines
2.0 KiB
PHP
59 lines
2.0 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
use Illuminate\Support\Facades\Artisan;
|
|
// Route::get('/', function () {
|
|
// return view('welcome');
|
|
// });
|
|
|
|
Auth::routes([
|
|
'register' => false, // Disables the registration routes
|
|
'reset' => false, // Disables the password reset routes
|
|
'verify' => false, // Disables the email verification routes
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
Route::get('/home', [App\Http\Controllers\DashboardController::class, 'index'])->name('home');
|
|
Route::get('/', [App\Http\Controllers\DashboardController::class, 'index'])->name('home');
|
|
|
|
|
|
|
|
|
|
Route::post('/api/subscriptions/sync', function () {
|
|
try {
|
|
// Run the artisan command programmatically
|
|
Artisan::call('subscriptions:sync');
|
|
|
|
return response()->json([
|
|
'status' => 'success',
|
|
'message' => 'Subscriptions synchronized successfully!'
|
|
]);
|
|
} catch (\Exception $e) {
|
|
return response()->json([
|
|
'status' => 'error',
|
|
'message' => 'Sync failed: ' . $e->getMessage()
|
|
], 500);
|
|
}
|
|
})->name('api.subscriptions.sync');
|
|
|
|
|
|
|
|
Route::middleware(['auth'])->group(function () {
|
|
Route::get('/', [App\Http\Controllers\DashboardController::class, 'index'])->name('dashboard.index');
|
|
|
|
|
|
Route::get('/api/dashboard/stats', [App\Http\Controllers\DashboardController::class, 'getStats'])->name('api.dashboard.stats');
|
|
|
|
|
|
Route::get('/services/create', [App\Http\Controllers\SubscriptionServiceController::class, 'create'])->name('services.create');
|
|
Route::post('/services', [App\Http\Controllers\SubscriptionServiceController::class, 'store'])->name('services.store');
|
|
|
|
Route::post('/services/test-connection', [App\Http\Controllers\SubscriptionServiceController::class, 'testConnection'])->name('services.test');
|
|
|
|
Route::get('/services/{id}/details', [App\Http\Controllers\DashboardController::class, 'details'])->name('services.details');
|
|
Route::get('/services/{serviceId}/subscriber/{msisdn}', [App\Http\Controllers\DashboardController::class, 'subscriberProfile'])->name('services.subscriber.profile');
|
|
|
|
}); |