Files
new_dqb_new/app/Models/Traits/HasOneCover.php
2021-03-24 09:51:17 +08:00

25 lines
392 B
PHP

<?php
namespace App\Models\Traits;
use Illuminate\Support\Facades\Storage;
trait HasOneCover
{
/**
* 拼接图片全地址
* @author 玄尘 2020-03-05
* @return string
*/
public function getCoverPathAttribute(): ?string
{
if ($this->cover) {
return Storage::url($this->cover);
} else {
return '';
}
}
}