You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
voucher/app/Models/CustomerAsDataPartner.php

53 lines
1.2 KiB
PHTML

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
class CustomerAsDataPartner extends Model
{
protected $fillable = [
'customer_id',
1 year ago
'id_number',
'job',
'image_selfie',
'file_statement',
'file_agreement',
'additional_json',
];
protected $appends = [
'image_selfie_url',
'file_statement_url',
'file_agreement_url',
];
public function imageSelfieUrl(): Attribute
{
return Attribute::make(get: function () {
if ($this->image_selfie != null) {
return asset($this->image_selfie);
}
return null;
});
}
public function fileStatementUrl(): Attribute
{
return Attribute::make(get: function () {
if ($this->file_statement != null) {
return asset($this->file_statement);
}
return null;
});
}
public function fileAgreementUrl(): Attribute
{
return Attribute::make(get: function () {
if ($this->file_agreement != null) {
return asset($this->file_agreement);
}
return null;
});
}
}