card pin order

This commit is contained in:
2024-03-07 17:30:04 +05:00
parent 20db738536
commit fbd5d94b2f
8 changed files with 478 additions and 14 deletions

View File

@@ -0,0 +1,77 @@
<?php
namespace App\Models\Order\Card\CardPin;
use App\Models\Branch\Branch;
use App\Models\Order\Card\CardType;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class CardPin extends Model
{
use HasFactory;
use SoftDeletes;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'unique_id',
'card_type_id',
'card_number',
'region',
'branch_id',
'customer_name',
'customer_surname',
'customer_patronic_name',
'born_at',
'phone',
'passport_serie',
'passport_id',
'status',
'passport_one',
'passport_two',
'passport_three',
'passport_four',
'notes',
'user_id',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'born_at' => 'date',
];
/**
* User
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* Card type
*/
public function cardType(): BelongsTo
{
return $this->belongsTo(CardType::class, 'card_type_id');
}
/**
* Branch
*/
public function branch(): BelongsTo
{
return $this->belongsTo(Branch::class, 'branch_id');
}
}