request Model is added
This commit is contained in:
29
app/Models/MarkList.php
Normal file
29
app/Models/MarkList.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MarkList extends Model
|
||||
{
|
||||
protected $table = 'mark_lists';
|
||||
|
||||
protected $fillable = [
|
||||
'mark_no', // e.g., MARK-2025-000001
|
||||
'origin',
|
||||
'destination',
|
||||
'customer_name',
|
||||
'mobile_no',
|
||||
'customer_id',
|
||||
'date',
|
||||
'status',
|
||||
];
|
||||
|
||||
/**
|
||||
* Relationship: each mark list belongs to a customer (user)
|
||||
*/
|
||||
public function customer()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'customer_id');
|
||||
}
|
||||
}
|
||||
24
app/Models/RequestModel.php
Normal file
24
app/Models/RequestModel.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RequestModel extends Model
|
||||
{
|
||||
protected $table = 'requests';
|
||||
|
||||
protected $fillable = [
|
||||
'request_id', // ✅ custom formatted ID like REQ-2025-000001
|
||||
'customer_name',
|
||||
'company_name',
|
||||
'designation',
|
||||
'email',
|
||||
'mobile_no',
|
||||
'priority',
|
||||
'address',
|
||||
'pincode',
|
||||
'date',
|
||||
'status',
|
||||
];
|
||||
}
|
||||
@@ -11,17 +11,33 @@ class User extends Authenticatable implements JWTSubject
|
||||
{
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'customer_id', // CID-2025-000001 format
|
||||
'customer_name',
|
||||
'company_name',
|
||||
'designation',
|
||||
'email',
|
||||
'mobile_no',
|
||||
'address',
|
||||
'pincode',
|
||||
'date',
|
||||
'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for arrays.
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
@@ -30,12 +46,17 @@ class User extends Authenticatable implements JWTSubject
|
||||
];
|
||||
}
|
||||
|
||||
// 🔑 Required for JWT
|
||||
/**
|
||||
* JWT Identifier.
|
||||
*/
|
||||
public function getJWTIdentifier()
|
||||
{
|
||||
return $this->getKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* JWT Custom Claims.
|
||||
*/
|
||||
public function getJWTCustomClaims()
|
||||
{
|
||||
return [];
|
||||
|
||||
Reference in New Issue
Block a user