領収証発行サービス
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

49 řádky
1.1KB

  1. <?php
  2. namespace App\Http\Controllers\Web\ReceiptIssuingOrder;
  3. use App\Codes\UserRole;
  4. use App\Http\Controllers\Web\IParam;
  5. use App\Http\Controllers\Web\WebController;
  6. use App\Logic\ReceiptIssuingOrder\CreateManager;
  7. use Illuminate\Http\JsonResponse;
  8. use Illuminate\Http\Request;
  9. class CreateController extends WebController
  10. {
  11. public function name(): string
  12. {
  13. return "領収証発行依頼新規作成";
  14. }
  15. public function description(): string
  16. {
  17. return "領収証発行依頼を新規作成する";
  18. }
  19. public function __construct(
  20. protected CreateParam $param,
  21. private CreateManager $manager
  22. ) {
  23. $this->middleware('auth:sanctum');
  24. $this->roleAllow(UserRole::NORMAL_ADMIN);
  25. }
  26. protected function getParam(): IParam
  27. {
  28. return $this->param;
  29. }
  30. protected function run(Request $request): JsonResponse
  31. {
  32. $param = $this->param;
  33. $this->manager->init()
  34. ->fill($param->toArray())
  35. ->create();
  36. return $this->successResponse();
  37. }
  38. }