38 lines
1.6 KiB
PHP
38 lines
1.6 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\Api\V1\CampaignController;
|
|
use App\Http\Controllers\Api\V1\CouponController;
|
|
use App\Http\Controllers\Api\V1\CustomerController;
|
|
use App\Http\Controllers\Api\V1\PrintController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| API Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register API routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider and all of them will
|
|
| be assigned to the "api" middleware group. Make something great!
|
|
|
|
|
*/
|
|
|
|
Route::namespace('\App\Http\Controllers\Api\V1')
|
|
->prefix('v1')
|
|
->group(function () {
|
|
Route::get('coupon/{publishedCoupon}', [CouponController::class, 'show']);
|
|
|
|
Route::get('campaign/{publishedCampaign}', [CampaignController::class, 'show']);
|
|
Route::get('campaign/{publishedCampaign}/coupons', [CampaignController::class, 'showWithCoupons']);
|
|
Route::get(
|
|
'campaign/{publishedCampaign}/coupons/{customer:hashcode}',
|
|
[CampaignController::class, 'showWithCouponsByCustomer']
|
|
)->withoutScopedBindings();
|
|
|
|
Route::get('customer/{customer:hashcode}', [CustomerController::class, 'show']);
|
|
Route::post('customer', [CustomerController::class, 'store']);
|
|
Route::put('customer/{customer:hashcode}', [CustomerController::class, 'update']);
|
|
Route::delete('customer/{customer:hashcode}', [CustomerController::class, 'destroy']);
|
|
|
|
Route::get('print', [PrintController::class, 'print']);
|
|
});
|