| 12345678910111213141516171819202122 |
- <?php
- namespace App\Models;
- use CodeIgniter\Model;
- class UserModel extends Model
- {
- protected $table = 'users';
- protected $primaryKey = 'id';
- protected $allowedFields = ['username', 'email', 'password_hash', 'role'];
- protected $returnType = 'array';
- protected $useTimestamps = true;
- // Método para buscar usuario por email
- public function findByEmail(string $email)
- {
- return $this->where('email', $email)->first();
- }
- }
|