39 lines
673 B
PHP
39 lines
673 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Traits\BelongsToCategory;
|
|
use App\Models\Traits\HasCovers;
|
|
|
|
class Video extends Model
|
|
{
|
|
|
|
use HasCovers,
|
|
BelongsToCategory;
|
|
|
|
/**
|
|
* Notes: 返回视频地址
|
|
*
|
|
* @Author: 玄尘
|
|
* @Date: 2021/11/29 15:43
|
|
* @return string
|
|
*/
|
|
public function getLinkUrlAttribute(): string
|
|
{
|
|
return $this->parseImageUrl($this->link);
|
|
}
|
|
|
|
/**
|
|
* Notes: 返回视频详情地址
|
|
*
|
|
* @Author: 玄尘
|
|
* @Date: 2021/11/29 15:43
|
|
* @return string
|
|
*/
|
|
public function getShowLinkAttribute(): string
|
|
{
|
|
return route('video.show', $this);
|
|
}
|
|
|
|
}
|