2026-07-22 21:16:17 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use App\Models\Site;
|
|
|
|
|
use Illuminate\Contracts\View\View;
|
|
|
|
|
|
|
|
|
|
class SiteController extends Controller
|
|
|
|
|
{
|
|
|
|
|
public function show(Site $site): View
|
|
|
|
|
{
|
2026-07-22 21:36:19 +03:00
|
|
|
$pages = $site->pages()->orderBy('url')->paginate(50, ['*'], 'pages_page');
|
2026-07-22 21:16:17 +03:00
|
|
|
|
2026-07-22 21:36:19 +03:00
|
|
|
$backlinks = $site->inboundLinks()
|
|
|
|
|
->with(['site', 'sitePage'])
|
|
|
|
|
->latest()
|
|
|
|
|
->paginate(50, ['*'], 'backlinks_page');
|
|
|
|
|
|
|
|
|
|
$referringDomainsCount = $site->inboundLinks()->distinct()->count('site_id');
|
|
|
|
|
$outboundLinksCount = $site->outboundLinks()->count();
|
|
|
|
|
|
|
|
|
|
return view('sites.show', [
|
|
|
|
|
'site' => $site,
|
|
|
|
|
'pages' => $pages,
|
|
|
|
|
'backlinks' => $backlinks,
|
|
|
|
|
'referringDomainsCount' => $referringDomainsCount,
|
|
|
|
|
'outboundLinksCount' => $outboundLinksCount,
|
|
|
|
|
]);
|
2026-07-22 21:16:17 +03:00
|
|
|
}
|
|
|
|
|
}
|