Files
Kent-logistics-Laravel/app/Models/User.php

65 lines
1.2 KiB
PHP
Raw Normal View History

2025-11-04 10:19:07 +05:30
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
2025-11-05 15:44:04 +05:30
use PHPOpenSourceSaver\JWTAuth\Contracts\JWTSubject;
2025-11-04 10:19:07 +05:30
2025-11-05 15:44:04 +05:30
class User extends Authenticatable implements JWTSubject
2025-11-04 10:19:07 +05:30
{
use HasFactory, Notifiable;
2025-11-07 12:08:34 +05:30
/**
* The attributes that are mass assignable.
*/
2025-11-04 10:19:07 +05:30
protected $fillable = [
2025-11-07 12:08:34 +05:30
'customer_id', // CID-2025-000001 format
'customer_name',
'company_name',
'designation',
2025-11-04 10:19:07 +05:30
'email',
2025-11-07 12:08:34 +05:30
'mobile_no',
'address',
'pincode',
'date',
2025-11-04 10:19:07 +05:30
'password',
];
2025-11-07 12:08:34 +05:30
/**
* The attributes that should be hidden for arrays.
*/
2025-11-04 10:19:07 +05:30
protected $hidden = [
'password',
'remember_token',
];
2025-11-07 12:08:34 +05:30
/**
* The attributes that should be cast.
*/
2025-11-04 10:19:07 +05:30
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
2025-11-05 15:44:04 +05:30
2025-11-07 12:08:34 +05:30
/**
* JWT Identifier.
*/
2025-11-05 15:44:04 +05:30
public function getJWTIdentifier()
{
return $this->getKey();
}
2025-11-07 12:08:34 +05:30
/**
* JWT Custom Claims.
*/
2025-11-05 15:44:04 +05:30
public function getJWTCustomClaims()
{
return [];
}
2025-11-04 10:19:07 +05:30
}