You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
668 B
33 lines
668 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
/**
|
|
* 频道列表
|
|
* Class Channel
|
|
* @package App\Models
|
|
*/
|
|
class Channel extends BaseModel
|
|
{
|
|
use HasFactory, SoftDeletes;
|
|
|
|
public function __construct(array $attributes = [])
|
|
{
|
|
parent::__construct($attributes);
|
|
$this->timestamps = false;
|
|
}
|
|
|
|
public function getIconAttribute($value): string
|
|
{
|
|
return $value ? $this->host . $value : '';
|
|
}
|
|
|
|
public function setIconAttribute($value)
|
|
{
|
|
//修改器里面$this->host变量为空
|
|
$this->attributes['license_pic'] = str_replace(env('APP_URL'), '', $value);
|
|
}
|
|
}
|