2026-07-20 00:04:45 +03:00
|
|
|
<?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);
|
|
|
|
|
}
|
2026-07-22 21:29:11 +03:00
|
|
|
|
|
|
|
|
/** 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');
|
|
|
|
|
}
|
2026-07-20 00:04:45 +03:00
|
|
|
}
|