init backend presensi
This commit is contained in:
1
app/Modules/Auth/Entities/.gitkeep
Normal file
1
app/Modules/Auth/Entities/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
# Auth Module - Entities
|
||||
26
app/Modules/Auth/Entities/Role.php
Normal file
26
app/Modules/Auth/Entities/Role.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\Auth\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
/**
|
||||
* Role Entity
|
||||
*/
|
||||
class Role extends Entity
|
||||
{
|
||||
public const CODE_ADMIN = 'ADMIN';
|
||||
public const CODE_WALI_KELAS = 'WALI_KELAS';
|
||||
public const CODE_GURU_BK = 'GURU_BK';
|
||||
public const CODE_GURU_MAPEL = 'GURU_MAPEL';
|
||||
public const CODE_ORANG_TUA = 'ORANG_TUA';
|
||||
|
||||
protected $allowedFields = [
|
||||
'role_code',
|
||||
'role_name',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
];
|
||||
}
|
||||
30
app/Modules/Auth/Entities/User.php
Normal file
30
app/Modules/Auth/Entities/User.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Modules\Auth\Entities;
|
||||
|
||||
use CodeIgniter\Entity\Entity;
|
||||
|
||||
/**
|
||||
* User Entity
|
||||
*/
|
||||
class User extends Entity
|
||||
{
|
||||
protected $allowedFields = [
|
||||
'name',
|
||||
'email',
|
||||
'password_hash',
|
||||
'is_active',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'is_active' => 'boolean',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function isActive(): bool
|
||||
{
|
||||
return (bool) ($this->attributes['is_active'] ?? true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user