You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.0KB

  1. <?php
  2. namespace App\Http\Controllers\Web\SeasonTicketContract;
  3. use App\Http\Controllers\Web\WebController;
  4. use App\Util\DateUtil;
  5. use Illuminate\Http\JsonResponse;
  6. use Illuminate\Http\Request;
  7. class TerminationOrderOptionsController extends WebController
  8. {
  9. public function name(): string
  10. {
  11. return "定期契約解約申請用オプション取得";
  12. }
  13. public function description(): string
  14. {
  15. return "定期契約解約依頼用のオプションを取得する";
  16. }
  17. public function __construct(protected TerminationOrderOptionsParams $param)
  18. {
  19. parent::__construct();
  20. $this->middleware('auth:sanctum');
  21. }
  22. protected function run(Request $request): JsonResponse
  23. {
  24. $param = $this->param;
  25. $monthes = [];
  26. foreach (range(0, 3) as $m) {
  27. $target = DateUtil::now()->addMonth($m)->endOfMonth();
  28. $monthes[] = $target->format('Y/m/d');
  29. }
  30. return $this->successResponse(['monthes' => $monthes]);
  31. }
  32. }