some progress
This commit is contained in:
@@ -11,6 +11,27 @@ use Illuminate\View\View;
|
||||
|
||||
class DnsRecordController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display overview of all DNS records across all sites
|
||||
*/
|
||||
public function overview(): View
|
||||
{
|
||||
$sites = Site::where('user_id', Auth::id())
|
||||
->withCount('dnsRecords')
|
||||
->with(['dnsRecords' => function ($query) {
|
||||
$query->where('is_active', true)->limit(5);
|
||||
}])
|
||||
->get();
|
||||
|
||||
$stats = [
|
||||
'total_sites' => $sites->count(),
|
||||
'total_dns_records' => $sites->sum('dns_records_count'),
|
||||
'sites_with_records' => $sites->where('dns_records_count', '>', 0)->count(),
|
||||
];
|
||||
|
||||
return view('dns-records.overview', compact('sites', 'stats'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the DNS records for a site.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user