EncodeCreated::class, 'updated' => EncodeUpdated::class, ]; /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ Encode::ATTRIBUTE_TYPE, Encode::ATTRIBUTE_USER, Encode::ATTRIBUTE_VIDEO, ]; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ Encode::ATTRIBUTE_TYPE => EncodeType::class, ]; } /** * Get name. */ public function getName(): string { return Str::of($this->user->getName()) ->append(' ') ->append($this->video->getName()) ->__toString(); } /** * Get subtitle. */ public function getSubtitle(): string { return ''; } /** * Gets the user that owns the encode. * * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class, Encode::ATTRIBUTE_USER); } /** * Gets the video that owns the encode. * * @return BelongsTo */ public function video(): BelongsTo { return $this->belongsTo(Video::class, Encode::ATTRIBUTE_VIDEO); } }