27 lines
941 B
PHP
27 lines
941 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Opportunity;
|
|
use App\Services\OpportunityPromotion;
|
|
use Illuminate\Http\Request;
|
|
use Inertia\Inertia;
|
|
|
|
final class OpportunityPromotionController extends Controller
|
|
{
|
|
public function show(Request $request, int $id, OpportunityPromotion $service): \Inertia\Response
|
|
{
|
|
return Inertia::render('management/opportunity-promotion', $service->editor($request->user(), Opportunity::findOrFail($id)));
|
|
}
|
|
|
|
public function preview(Request $request, int $id, OpportunityPromotion $service): \Illuminate\Http\JsonResponse
|
|
{
|
|
return response()->json($service->preview($request->user(), Opportunity::findOrFail($id), $request->all()));
|
|
}
|
|
|
|
public function confirm(Request $request, int $id, OpportunityPromotion $service): \Illuminate\Http\JsonResponse
|
|
{
|
|
return response()->json($service->confirm($request->user(), $id, $request->all()));
|
|
}
|
|
}
|