Files
ERP-upgrade/app/Models/StaffMember.php

30 lines
741 B
PHP

<?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class StaffMember extends Authenticatable
{
use HasFactory, Notifiable;
// 1. Explicitly define the custom table name
protected $table = 'staff_members';
// 2. Define the fillable fields based on your schema
protected $guarded = ['id'];
// 3. Hide the password from array/JSON conversions
protected $hidden = [
'password',
];
// 4. Cast dates correctly
protected $casts = [
'dob' => 'date',
'hire_date' => 'datetime',
'password' => 'hashed', // Laravel 10+ password casting
];
}