|
- <?php
-
- namespace App\Mail\Members;
-
- use App\Models\ResetPassword;
- use Illuminate\Support\Carbon;
-
- class ResetPasswordStart extends Member
- {
-
- protected string $token;
- protected Carbon $expiresAt;
-
- protected $casts = [
- 'expiresAt' => 'datetime',
- ];
-
- /**
- * Create a new message instance.
- *
- * @return void
- */
- public function __construct(ResetPassword $model)
- {
- $this->setValues($model->toArray());
- }
-
- public function getTemplateName(): string
- {
- return 'mails.members.reset_password_start';
- }
-
- public function getSubject(): string
- {
- return '【スマートパーキングパス】パスワードリセット手続きのご案内';
- }
-
- public function getMemberParams(): array
- {
- return [
- 'url' => $this->getUrl(),
- 'expiresAt' => $this->getExpiresAt(),
- ];
- }
-
- private function getUrl()
- {
- return implode(
- "/",
- [
- config("app.url"),
- 'password-reset',
- $this->token
- ]
- );
- }
- private function getExpiresAt()
- {
- return $this->expiresAt->format('Y/m/d H:i');
- }
- }
|