request Model is added

This commit is contained in:
Abhishek Mali
2025-11-07 12:08:34 +05:30
parent 3c4727acd9
commit 5b764c7597
15 changed files with 466 additions and 141 deletions

29
app/Models/MarkList.php Normal file
View 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');
}
}

View 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',
];
}

View File

@@ -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 [];