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.

38 lines
837 B
PHTML

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Support\Carbon;
class PaylaterTenorHistory extends Model
{
protected $fillable = [
'customer_id',
'day_deadline',
'file_agreement',
'description',
];
protected $appends = ['format_created_at', 'file_agreement_url'];
public function customer()
{
return $this->belongsTo(Customer::class);
}
public function formatCreatedAt(): Attribute
{
return Attribute::make(get: function () {
return Carbon::parse($this->created_at)->translatedFormat('d F Y H:i:s');
});
}
public function fileAgreementUrl(): Attribute
{
return Attribute::make(get: function () {
return asset($this->file_agreement);
});
}
}