Files
ProjectKP/KP-ASOY FIX (2)/KP-ASOY/app/Models/User.php
T
2026-06-28 15:14:51 +07:00

50 lines
959 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use HasFactory, Notifiable;
/**
* Kolom yang boleh diisi (Mass Assignment)
*/
protected $fillable = [
'name',
'username',
'email',
'password',
'role',
];
/**
* Kolom yang disembunyikan
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Casting format data
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed', // Laravel akan otomatis nge-hash saat save()
];
}
/**
* Relasi ke Activities
*/
public function activities()
{
return $this->hasMany(Activity::class);
}
}