<?php

namespace App\Validation;

use App\Models\ModelUser;


class UserRules
{
    public function validateUser(string $str, string $fields, array $data)
    {
        $model = new ModelUser();
        $user = $model->where('email', $data['email'])
            ->first();

        if (!$user)
            return false;
        return password_verify($data['password'], $user['password']);
    }
}
