Update Fix

This commit is contained in:
2026-03-06 03:26:11 +07:00
commit 8090007f39
15987 changed files with 2350525 additions and 0 deletions

62
app/Models/User.php Normal file
View File

@@ -0,0 +1,62 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'email',
'password',
'role',
'nip',
'pegawai_id',
];
public const ROLE_ADMIN = 'admin';
public const ROLE_KASIR = 'kasir';
public const ROLE_GUDANG = 'gudang';
public function isAdmin(): bool
{
return $this->role === self::ROLE_ADMIN;
}
public function pegawai()
{
return $this->belongsTo(Pegawai::class);
}
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}