All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 55s
37 lines
718 B
PHP
37 lines
718 B
PHP
<?php
|
|
|
|
namespace App\Modules\Finance\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class UtilityFeeAttachment extends Model
|
|
{
|
|
protected $fillable = [
|
|
'utility_fee_id',
|
|
'file_path',
|
|
'original_name',
|
|
'mime_type',
|
|
'size',
|
|
];
|
|
|
|
protected $appends = ['url'];
|
|
|
|
/**
|
|
* 附件所属的公共事業費
|
|
*/
|
|
public function utilityFee(): BelongsTo
|
|
{
|
|
return $this->belongsTo(UtilityFee::class);
|
|
}
|
|
|
|
/**
|
|
* 獲取附件的全路徑 URL
|
|
*/
|
|
public function getUrlAttribute()
|
|
{
|
|
return tenant_asset($this->file_path);
|
|
}
|
|
}
|