Auth, Login, Home, Venta->Listados->Precios
This commit is contained in:
28
app/src/Model/User.php
Normal file
28
app/src/Model/User.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace Incoviba\Model;
|
||||
|
||||
use Incoviba\Common\Ideal;
|
||||
use function password_verify;
|
||||
|
||||
class User extends Ideal\Model
|
||||
{
|
||||
public string $name;
|
||||
public string $password;
|
||||
public bool $enabled;
|
||||
|
||||
public function validate(string $provided_password): bool
|
||||
{
|
||||
return password_verify($provided_password, $this->password);
|
||||
}
|
||||
public function isAdmin(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return array_merge(parent::jsonSerialize(), [
|
||||
'name' => $this->name
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user