*/ protected $fillable = [ Like::ATTRIBUTE_USER, Like::ATTRIBUTE_LIKEABLE_TYPE, Like::ATTRIBUTE_LIKEABLE_ID ]; /** * Get name. * * @return string */ public function getName(): string { return strval($this->getKey()); } /** * Gets the user that owns the like. * * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class, Like::ATTRIBUTE_USER); } /** * Gets the video that owns the like. * * @return MorphTo */ public function likeable(): MorphTo { return $this->morphTo(); } }