VideoTemp.php
782 Bytes
<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class VideoTemp extends Model
{
use HasDateTimeFormatter;
const POSITION_OPTIONS = [
'topLeft'=>'上左','topMiddle'=>'上中','topRight'=>'上右',
'midLeft'=>'中左','midMiddle'=>'中中','midRight'=>'中右',
'botLeft'=>'下左','botMiddle'=>'下中','botRight'=>'下右',
];
protected $table = 'video_temp';
protected $guarded = [''];
public function components()
{
return $this->hasMany('App\Models\Component','temp_id');
}
public function componentsTable()
{
return $this->hasMany('App\Models\Component','temp_id')->select(['id','temp_id','name','position','font_size']);
}
}