mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-06 04:35:11 +02:00
23 lines
438 B
PHP
23 lines
438 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Concerns\Models\Aggregate;
|
|
|
|
use App\Models\Aggregate\LikeAggregate;
|
|
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
|
|
|
trait AggregatesLike
|
|
{
|
|
/**
|
|
* @return MorphOne<LikeAggregate, $this>
|
|
*/
|
|
public function likeAggregate(): MorphOne
|
|
{
|
|
return $this->morphOne(
|
|
LikeAggregate::class,
|
|
LikeAggregate::ATTRIBUTE_LIKEABLE,
|
|
);
|
|
}
|
|
}
|