Files
ismailmasseran e29a5891c8 Bugfix/list clickup issue (#5)
Reviewed-on: #5
Co-authored-by: ISMAIL MASSERAN <ismail@koppkb.com>
Co-committed-by: ISMAIL MASSERAN <ismail@koppkb.com>
2026-10-19 13:30:36 +08:00

80 lines
1.7 KiB
PHP

<?php
namespace App\Models;
use App\Notifications\PasswordResetNotification;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, HasRoles, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var string[]
*/
protected $fillable = [
'name',
'username',
'email',
'password',
'token',
'is_verified',
'kodcaw',
'nokp',
'bank_acc_pembeli',
'bank_acc_no_pembeli',
'alamat',
'notelpejabat',
'notelbimbit',
'note',
'status',
't_daftar',
'online',
'register_agree',
'disahkan_pada',
'disahkan_oleh',
];
/**
* The attributes that should be hidden for serialization.
*
* @var array
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
public function sendPasswordResetNotification($token)
{
$this->notify(new PasswordResetNotification($token));
// $user->notify(new PasswordResetNotification($user));
}
public function cawangan()
{
return $this->hasOne(Cawangan::class, 'caw_code', 'kodcaw');
}
public function payment()
{
return $this->hasMany(Payment::class, 'user_id', 'id');
}
}