Files
huginn/app/Models/Site.php
T

36 lines
797 B
PHP
Raw Normal View History

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Site extends Model
{
protected $fillable = [
'collection',
'domain',
'url',
'title',
'description',
'keywords',
];
public function pages(): HasMany
{
return $this->hasMany(SitePage::class);
}
/** Links this site's pages make out to other domains. */
public function outboundLinks(): HasMany
{
return $this->hasMany(Backlink::class);
}
/** Backlinks pointing at this site, i.e. rows recorded against its domain as the target. */
public function inboundLinks(): HasMany
{
return $this->hasMany(Backlink::class, 'target_domain', 'domain');
}
}