Initial commit
This commit is contained in:
22
laravel/app/Data/Auth/LoginData.php
Normal file
22
laravel/app/Data/Auth/LoginData.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Data\Auth;
|
||||
|
||||
final readonly class LoginData
|
||||
{
|
||||
public function __construct(
|
||||
public string $email,
|
||||
public string $password
|
||||
) {
|
||||
}
|
||||
|
||||
public static function fromArray(array $data): self
|
||||
{
|
||||
return new self(
|
||||
email: strtolower(trim($data['email'])),
|
||||
password: $data['password']
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user