- 134-tool registry with programmatic SEO (unique titles/H1/descriptions, JSON-LD graphs, sitemap index, canonical 301 enforcement via required filter) - DB-backed job queue (SKIP LOCKED) with drivers: Ffmpeg, Images (GD), Pdf (qpdf/gs/poppler), Youtube (thumbnails), Qr (server-side PNG) - Security: SSRF guard, MIME validation, rate limits, API-key auth, bcrypt admin login, security headers - Admin panel: dashboard, tools/categories/guides CRUD, SEO audit, analytics, job inspector with retry, system health, feature flags - Docker deployment (nginx + web/api FPM pools + scalable workers), PHPUnit suite (19 tests / 1139 assertions), PWA manifest + service worker
57 lines
1.7 KiB
PHP
57 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controllers;
|
|
|
|
/**
|
|
* Error pages. Every one offers a route back into the toolbox.
|
|
* Deliberately standalone (works when invoked from the router's 404
|
|
* override without full initController).
|
|
*/
|
|
final class Errors extends BaseController
|
|
{
|
|
public function showNotFound(): string
|
|
{
|
|
return $this->notFound();
|
|
}
|
|
|
|
public function notFound(): string
|
|
{
|
|
service('analytics')->sessionHash(); // ensure session exists for ownership checks
|
|
service('seo')->title('Tool not found')
|
|
->description('The page you requested does not exist. Browse popular tools instead.')
|
|
->noIndex();
|
|
|
|
// status rides the shared response; body returned as string
|
|
service('response')->setStatusCode(404);
|
|
|
|
return view('errors/tool_not_found', [
|
|
'popular' => service('finder')->popular(6),
|
|
'categories' => service('finder')->categories(),
|
|
]);
|
|
}
|
|
|
|
public function forbidden(): string
|
|
{
|
|
service('seo')->title('Access denied')->noIndex();
|
|
service('response')->setStatusCode(403);
|
|
|
|
return view('errors/http', [
|
|
'code' => 403, 'title' => 'Access denied',
|
|
'message' => 'You do not have permission to view this page.',
|
|
]);
|
|
}
|
|
|
|
public function serverError(): string
|
|
{
|
|
service('seo')->title('Something went wrong')->noIndex();
|
|
service('response')->setStatusCode(500);
|
|
|
|
return view('errors/http', [
|
|
'code' => 500, 'title' => 'Something went wrong',
|
|
'message' => 'Our team has been notified. Please try again in a moment.',
|
|
]);
|
|
}
|
|
}
|