File: D:/HostingSpaces/SBogers10/cafe-de-bout.komma.pro/app/Components/Component/ComponentableTrait.php
<?php
namespace App\Components\Component;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\MorphToMany;
/**
* Trait ComponentableTrait
*
* Defines a model trait that is linkable (componentable) to one or more components.
*
* @see Component
* @mixin \Eloquent
*
* @package App\Components\Component
*/
trait ComponentableTrait
{
/**
* @return MorphToMany
* @see Component::componentables()
*/
public function components(): BelongsToMany {
return $this->morphToMany(Component::class, 'componentable')->withTimestamps();
}
}