Initial commit: Pireon Admin — headless admin panel and public API
Laravel 13 + Filament 5 admin panel and REST API for a non-profit developer collective, backed by the Pireon OAuth identity server. The public site is a separate, server-rendered application consuming /api/public/v1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
50
app/Support/Health/Checks/ServicesWithoutWork.php
Normal file
50
app/Support/Health/Checks/ServicesWithoutWork.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Support\Health\Checks;
|
||||
|
||||
use App\Filament\Resources\Services\ServiceResource;
|
||||
use App\Models\Service;
|
||||
use App\Support\Health\Check;
|
||||
use App\Support\Health\Finding;
|
||||
|
||||
/**
|
||||
* Published services with no published work behind them.
|
||||
*
|
||||
* A service that cannot point at something real is a promise, and a landing
|
||||
* page made of promises is the kind visitors have learned to skim past. The
|
||||
* listing already flags this in orange; this is the same fact where somebody
|
||||
* will see it without going looking.
|
||||
*/
|
||||
class ServicesWithoutWork implements Check
|
||||
{
|
||||
public function key(): string
|
||||
{
|
||||
return 'services-without-work';
|
||||
}
|
||||
|
||||
public function permission(): ?string
|
||||
{
|
||||
return 'services.view_any';
|
||||
}
|
||||
|
||||
public function run(): Finding
|
||||
{
|
||||
$default = (string) config('locales.default');
|
||||
|
||||
$services = Service::query()
|
||||
->published()
|
||||
->whereDoesntHave('projects', fn ($q) => $q->published())
|
||||
->get(['id', 'title']);
|
||||
|
||||
return Finding::problem(
|
||||
$this->key(),
|
||||
$services->count(),
|
||||
url: ServiceResource::getUrl('index'),
|
||||
samples: $services
|
||||
->map(fn (Service $s) => $s->getTranslation('title', $default, false))
|
||||
->all(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user