| Current Path : /var/www/html/dynaweb-starter/plugin/dynaweb-site/src/Models/ |
| Current File : /var/www/html/dynaweb-starter/plugin/dynaweb-site/src/Models/FrontendPageComponent.php |
<?php
namespace Dynaweb\DynawebSite\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\{BelongsToMany, BelongsTo};
class FrontendPageComponent extends Model
{
use HasFactory;
/**
* The Relationship.
*/
// public function page(): BelongsToMany
// {
// return $this->belongsToMany(FrontendPage::class, 'page_fk');
// }
/**
* The Relationship.
*/
public function component(): BelongsTo
{
return $this->belongsTo(FrontendComponent::class, 'component_fk');
}
/**
* The Relationship.
*/
public function page(): BelongsTo
{
return $this->belongsTo(FrontendPage::class, 'page_fk');
}
}