name('apiV2.')->group(function () { // * PUBLIC Route::get('/ping', [V2ApiController::class, 'ping'])->name('ping'); // * PRIVATE Route::middleware('auth:api')->group(function () { // * OPTINS Route::post('/optin', [V2OptinController::class, 'optin'])->name('optin'); Route::post('/optout', [V2OptinController::class, 'optoutWithHashcode'])->name('optout-hashcode'); // * CUSTOMERS Route::apiResource('customers', V2CustomerController::class, [ 'except' => 'index', 'parameters' => ['customers' => 'serviceCustomer'] ]); Route::prefix('customers')->name('customers.')->group(function () { Route::post('/authenticate', [V2CustomerController::class, 'authenticate'])->name('authenticate'); Route::prefix('{serviceCustomer}')->group(function () { Route::post('/activate', [V2CustomerController::class, 'activateAccount'])->name('activate'); Route::post('/answers', [V2AnswerController::class, 'storeCustomerAnswers']) ->name('answers.store'); }); }); // * ARCADIA Route::prefix('arcadia')->name('arcadia.')->group(function () { Route::post('/outgoing-mail/default', [V2ArcadiaController::class, 'outgoingMailDefault']) ->name('outgoingMailDefault'); Route::post('/outgoing-mail/game', [V2ArcadiaController::class, 'outgoingMailGame']) ->name('outgoingMailGame'); }); // * QUESTIONS Route::apiResource('questions', V2QuestionController::class, [ 'parameters' => ['questions' => 'serviceQuestion'] ])->only('index'); Route::prefix('questions')->name('questions.')->group(function () { Route::get('/un-answered-by/{serviceCustomer}', [V2QuestionController::class, 'unAnsweredBy']) ->name('unAnsweredBy'); Route::get('/with-answers/{serviceCustomer}', [V2QuestionController::class, 'indexWithResponse']) ->name('indexWithResponse'); }); // * STATS Route::prefix('stats')->name('stats.')->group(function () { Route::get('/brand', [V2StatsController::class, 'brandStats']) ->name('brandStats'); Route::get('/question/{serviceQuestion}', [V2StatsController::class, 'questionStats']) ->name('questionStats'); }); }); }); Route::prefix('v4')->name('apiV4.')->group(function () { // * PUBLIC Route::get('/ping', [V4ApiController::class, 'ping'])->name('ping'); // * PRIVATE Route::middleware('auth:api')->group(function () { // * OPTINS Route::post('/optin', [V4OptinController::class, 'optin'])->name('optin'); Route::post('/optout', [V4OptinController::class, 'optoutWithHashcode'])->name('optout-hashcode'); // * CUSTOMERS Route::apiResource('customers', V4CustomerController::class, [ 'except' => 'index', 'parameters' => ['customers' => 'serviceCustomer'] ]); Route::prefix('customers')->name('customers.')->group(function () { Route::post('/authenticate', [V4CustomerController::class, 'authenticate'])->name('authenticate'); Route::prefix('{serviceCustomer}')->group(function () { Route::post('/activate', [V4CustomerController::class, 'activateAccount'])->name('activate'); Route::post('/answers', [V4AnswerController::class, 'storeCustomerAnswers']) ->name('answers.store'); }); }); // * ARCADIA Route::prefix('arcadia')->name('arcadia.')->group(function () { Route::post('/outgoing-mail/default', [V4ArcadiaController::class, 'outgoingMailDefault']) ->name('outgoingMailDefault'); Route::post('/outgoing-mail/game', [V4ArcadiaController::class, 'outgoingMailGame']) ->name('outgoingMailGame'); }); // * QUESTIONS Route::apiResource('questions', V4QuestionController::class, [ 'parameters' => ['questions' => 'serviceQuestion'] ])->only('index'); Route::prefix('questions')->name('questions.')->group(function () { Route::get('/un-answered-by/{serviceCustomer}', [V4QuestionController::class, 'unAnsweredBy']) ->name('unAnsweredBy'); Route::get('/with-answers/{serviceCustomer}', [V4QuestionController::class, 'indexWithResponse']) ->name('indexWithResponse'); }); // * STATS Route::prefix('stats')->name('stats.')->group(function () { Route::get('/brand', [V4StatsController::class, 'brandStats']) ->name('brandStats'); Route::get('/question/{serviceQuestion}', [V4StatsController::class, 'questionStats']) ->name('questionStats'); }); }); });