15 lines
346 B
PHP
15 lines
346 B
PHP
<?php
|
|
namespace App\Validation;
|
|
|
|
use App\Models\UsersModel;
|
|
|
|
class Usersrules {
|
|
public function validateUser(string $str, string $fields, array $data) {
|
|
$model = new UsersModel();
|
|
$user = $model->where('email_1', $data['email'])->first();
|
|
|
|
if (!$user) { return false; }
|
|
|
|
return password_verify($data['password'], $user['password']);
|
|
}
|
|
} |