領収証発行サービス
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.

62 lines
1.2KB

  1. <?php
  2. namespace App\Mail\Members;
  3. use App\Models\ResetPassword;
  4. use Illuminate\Support\Carbon;
  5. class ResetPasswordStart extends Member
  6. {
  7. protected string $token;
  8. protected Carbon $expiresAt;
  9. protected $casts = [
  10. 'expiresAt' => 'datetime',
  11. ];
  12. /**
  13. * Create a new message instance.
  14. *
  15. * @return void
  16. */
  17. public function __construct(ResetPassword $model)
  18. {
  19. $this->setValues($model->toArray());
  20. }
  21. public function getTemplateName(): string
  22. {
  23. return 'mails.members.reset_password_start';
  24. }
  25. public function getSubject(): string
  26. {
  27. return '【スマートパーキングパス】パスワードリセット手続きのご案内';
  28. }
  29. public function getMemberParams(): array
  30. {
  31. return [
  32. 'url' => $this->getUrl(),
  33. 'expiresAt' => $this->getExpiresAt(),
  34. ];
  35. }
  36. private function getUrl()
  37. {
  38. return implode(
  39. "/",
  40. [
  41. config("app.url"),
  42. 'password-reset',
  43. $this->token
  44. ]
  45. );
  46. }
  47. private function getExpiresAt()
  48. {
  49. return $this->expiresAt->format('Y/m/d H:i');
  50. }
  51. }