mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-09-06 04:35:11 +02:00
25 lines
505 B
PHP
25 lines
505 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Concerns\Models\Aggregate;
|
|
|
|
use App\Models\Aggregate\ViewAggregate;
|
|
use Illuminate\Database\Eloquent\Relations\MorphOne;
|
|
|
|
trait AggregatesView
|
|
{
|
|
final public const RELATION_VIEW_AGGREGATE = 'viewAggregate';
|
|
|
|
/**
|
|
* @return MorphOne<ViewAggregate, $this>
|
|
*/
|
|
public function viewAggregate(): MorphOne
|
|
{
|
|
return $this->morphOne(
|
|
ViewAggregate::class,
|
|
ViewAggregate::ATTRIBUTE_VIEWABLE,
|
|
);
|
|
}
|
|
}
|