use native session dates

This commit is contained in:
Yisroel Baum 2026-07-31 10:15:35 +03:00
parent 88a3997bad
commit ad27a0f03c
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 4 additions and 5 deletions

View file

@ -3,7 +3,6 @@
namespace App\Auth; namespace App\Auth;
use App\User\UserRepository; use App\User\UserRepository;
use Carbon\CarbonInterface;
use DateTimeImmutable; use DateTimeImmutable;
use DateTimeZone; use DateTimeZone;
@ -55,7 +54,7 @@ class EloquentSessionRepository implements SessionRepository
SessionModel::where('token', $token)->delete(); SessionModel::where('token', $token)->delete();
} }
private function toUtc(CarbonInterface $dateTime): DateTimeImmutable private function toUtc(DateTimeImmutable $dateTime): DateTimeImmutable
{ {
return DateTimeImmutable::createFromInterface($dateTime) return DateTimeImmutable::createFromInterface($dateTime)
->setTimezone(new DateTimeZone('UTC')); ->setTimezone(new DateTimeZone('UTC'));

View file

@ -2,7 +2,7 @@
namespace App\Auth; namespace App\Auth;
use Carbon\CarbonInterface; use DateTimeImmutable;
use Illuminate\Database\Eloquent\Attributes\Fillable; use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
@ -10,8 +10,8 @@ use Illuminate\Database\Eloquent\Model;
/** /**
* @property string $token * @property string $token
* @property int $user_id * @property int $user_id
* @property CarbonInterface $created_at * @property DateTimeImmutable $created_at
* @property CarbonInterface $expires_at * @property DateTimeImmutable $expires_at
* *
* @method static Builder<static>|SessionModel newModelQuery() * @method static Builder<static>|SessionModel newModelQuery()
* @method static Builder<static>|SessionModel newQuery() * @method static Builder<static>|SessionModel newQuery()