init backend presensi

This commit is contained in:
mwpn
2026-03-05 14:37:36 +07:00
commit b4fda6b9c9
319 changed files with 27261 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<?php
namespace App\Modules\Auth\Models;
use App\Modules\Auth\Entities\User;
use CodeIgniter\Model;
/**
* User Model
*/
class UserModel extends Model
{
protected $table = 'users';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = User::class;
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [
'name',
'email',
'password_hash',
'is_active',
];
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $validationRules = [
'name' => 'required|max_length[255]',
'email' => 'required|valid_email|max_length[255]|is_unique[users.email,id,{id}]',
'password_hash' => 'required|max_length[255]',
'is_active' => 'permit_empty|in_list[0,1]',
];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
public function findByEmail(string $email): ?User
{
return $this->where('email', $email)->first();
}
}