File: D:/HostingSpaces/SBogers10/ste.komma.pro/app/Components/Componentables/ComponentableType.php
<?php
namespace App\Components\Componentables;
use App\Components\Component\Component;
use App\Components\ComponentType;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
/**
* App\Components\Componentables\ComponentableType
*
* @property int $id
* @property int $component_type_id
* @property string|null $componentable_type
* @property string|null $model_collection_provider
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Components\ComponentType $componentType
* @method static \Illuminate\Database\Eloquent\Builder|\App\Components\Componentables\ComponentableType whereComponentTypeId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Components\Componentables\ComponentableType whereComponentableType($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Components\Componentables\ComponentableType whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Components\Componentables\ComponentableType whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Components\Componentables\ComponentableType whereModelCollectionProvider($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Components\Componentables\ComponentableType whereUpdatedAt($value)
* @mixin \Eloquent
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Components\Component\Component[] $components
* @method static \Illuminate\Database\Eloquent\Builder|\App\Components\Componentables\ComponentableType newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Components\Componentables\ComponentableType newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Components\Componentables\ComponentableType query()
*/
class ComponentableType extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['component_type_id', 'componentable_type', 'model_collection_provider'];
public function componentType():HasOne
{
return $this->hasOne(ComponentType::class);
}
public function components(): BelongsToMany
{
return $this->belongsToMany(Component::class);
}
}