98 lines
2.3 KiB
PHP
98 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models\Order\Loan;
|
|
|
|
use App\Models\Branch\Branch;
|
|
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;
|
|
use Laravel\Nova\Actions\Actionable;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property null|string $unique_id
|
|
* @property string $region
|
|
* @property int $branch_id
|
|
* @property string $customer_name
|
|
* @property string $customer_surname
|
|
* @property null|string $customer_patronic_name
|
|
* @property null|string $born_at
|
|
* @property null|string $phone
|
|
* @property string $passport_serie
|
|
* @property string $passport_id
|
|
* @property null|string $status
|
|
* @property null|string $notes
|
|
* @property int $user_id
|
|
* @property null|string $loan_contract_number
|
|
* @property null|string $loan_contract_date
|
|
* @property null|string $loan_amount
|
|
* @property null|string $loan_reason
|
|
* @property \Illuminate\Support\Carbon $created_at
|
|
* @property \Illuminate\Support\Carbon $updated_at
|
|
* @property \Illuminate\Support\Carbon $deleted_at
|
|
*/
|
|
class LoanPaidOffLetterOrder extends Model
|
|
{
|
|
use Actionable;
|
|
use HasFactory;
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'loan_paid_off_letter_orders';
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array<int, string>
|
|
*/
|
|
protected $fillable = [
|
|
'unique_id',
|
|
'region',
|
|
'branch_id',
|
|
'customer_name',
|
|
'customer_surname',
|
|
'customer_patronic_name',
|
|
'born_at',
|
|
'phone',
|
|
'passport_serie',
|
|
'passport_id',
|
|
'loan_contract_number',
|
|
'loan_contract_date',
|
|
'loan_amount',
|
|
'loan_reason',
|
|
'status',
|
|
'notes',
|
|
'user_id',
|
|
];
|
|
|
|
/**
|
|
* The attributes that should be cast.
|
|
*
|
|
* @var array<string, string>
|
|
*/
|
|
protected $casts = [
|
|
'born_at' => 'date',
|
|
];
|
|
|
|
/**
|
|
* User
|
|
*
|
|
* @return BelongsTo<User, LoanPaidOffLetterOrder>
|
|
*/
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
/**
|
|
* Branch
|
|
*
|
|
* @return BelongsTo<Branch, LoanPaidOffLetterOrder>
|
|
*/
|
|
public function branch(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Branch::class, 'branch_id');
|
|
}
|
|
}
|