ldc-mesbr-app/routes/api.php
Vincent BRIDIER b7cb4c0ab4
Merge API
2023-11-24 20:26:29 +01:00

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']);
});