### GET /setup Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Displays the setup page for initial configuration. ```APIDOC ## GET /setup ### Description Displays the setup page for initial configuration. ### Method GET ### Endpoint /setup ### Response #### Success Response (200) - **body** (HTML) - The setup page content. #### Response Example ```html ... ``` ``` -------------------------------- ### Settings usage example Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/settings.md Shows how to read and write settings using the AppSettings class. The example reads the 'name' property, sets a new value, and saves it, which persists and refreshes the cache. ```php use Cachet\Settings\AppSettings; use Cachet\Settings\ThemeSettings; $app = app(AppSettings::class); echo $app->name; // 'Cachet' $app->name = 'My Status'; $app->save(); // persisted + cache refreshed ``` -------------------------------- ### Run cachet:version command Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/commands.md Executes the cachet:version Artisan command, which displays the installed Cachet version. The example output shows 'Cachet 3.x-dev is installed ⚡'. ```bash php artisan cachet:version # Cachet 3.x-dev is installed ⚡ ``` -------------------------------- ### POST /setup Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Submits the setup form to configure the application. ```APIDOC ## POST /setup ### Description Submits the setup form to configure the application. ### Method POST ### Endpoint /setup ### Request Body - **fields** (object) - Required - The setup configuration fields. ### Request Example ```json { "app_name": "Cachet", "admin_email": "admin@example.com" } ``` ### Response #### Success Response (200) - **body** (HTML) - The setup result page. #### Response Example ```html ... ``` ``` -------------------------------- ### Usage example for components() Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/status.md Shows how to access the tally and compute the operational percentage. ```php $tally = $status->components(); $percent = $tally->operational / $tally->total * 100; ``` -------------------------------- ### Usage example for ScheduleBuilder Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/helpers.md Example of using the ScheduleBuilder methods to query schedules that are in progress and in the past. ```php use Cachet\Models\Schedule; $ongoing = Schedule::query()->inProgress()->get(); $done = Schedule::query()->inThePast()->get(); ``` -------------------------------- ### BulkDeleteResources usage example Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/actions.md Example of calling BulkDeleteResources with a Component model and a closure that invokes a delete action. ```php $bulkDelete->handle($request, Component::class, fn (Component $c) => $deleteComponentAction->handle($c)); ``` -------------------------------- ### Usage example for current() Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/status.md Shows how to resolve the Status service and output the current status value and label. ```php use Cachet\Status; $status = app(Status::class); echo $status->current()->value; // e.g. "operational" echo $status->current()->getLabel(); // e.g. "All Systems Operational" ``` -------------------------------- ### Send NewIncidentNotification example Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/events.md Example of sending a NewIncidentNotification to a subscriber. Requires a Subscriber instance and an Incident instance. ```php use Cachet\Notifications\NewIncidentNotification; $subscriber->notify(new NewIncidentNotification($incident)); ``` -------------------------------- ### Usage example with error handling Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/status.md Shows how to catch exceptions when resolving system status (e.g., before database migration) and return a JSON response. ```php use Cachet\Status; use Cachet\Enums\SystemStatusEnum; $status = app(Status::class); try { $systemStatus = $status->current(); } catch (\Throwable $e) { // e.g. before the database is migrated, the component/incident queries fail Log::error('Could not resolve system status', ['exception' => $e]); $systemStatus = SystemStatusEnum::operational; } $response = response()->json([ 'status' => $systemStatus->name, 'message' => $systemStatus->getLabel(), ]); ``` -------------------------------- ### ChangeComponentStatus usage example Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/actions.md Example of using ChangeComponentStatus to set a component to major_outage with a monitor source and a reason. ```php $component = app(ChangeComponentStatus::class)->handle( $component, ComponentStatusEnum::major_outage, ComponentStatusSourceEnum::Monitor, reason: 'HTTP 500 observed', ); ``` -------------------------------- ### Cachet::version() - Get Cachet version string Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/cachet.md Returns the version string read from the VERSION file (e.g., 3.x-dev). Example: echo Cachet::version(); → 3.x-dev. ```php public static function version(): string ``` -------------------------------- ### GET /incidents/{incident:guid} Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Displays a specific incident identified by its GUID. Returns 404 when the incident is not viewable. ```APIDOC ## GET /incidents/{incident:guid} ### Description Displays a specific incident identified by its GUID. Returns 404 when the incident is not viewable. ### Method GET ### Endpoint /incidents/{incident:guid} ### Parameters #### Path Parameters - **incident** (guid) - Required - The GUID of the incident. ### Response #### Success Response (200) - **body** (HTML) - The incident page content. #### Error Response (404) - **body** (HTML) - Not found page when incident is not viewable. #### Response Example ```html ... ``` ``` -------------------------------- ### Creating and reading metric points Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/models-operations.md Example of finding a metric, creating a metric point with a value and counter, and retrieving the calculated value from the most recent points. ```php $metric = Metric::query()->find(1); $metric->metricPoints()->create(['value' => 0.75, 'counter' => 1]); echo $metric->recentMetricPoints(10)->get()->first()->calculated_value; ``` -------------------------------- ### Command signature and description for cachet:version Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/commands.md Defines the signature and description for the cachet:version command. Prints 'Cachet {version} is installed ⚡' using Cachet::version(). ```plaintext signature: cachet:version description: "Display the version of Cachet" ``` -------------------------------- ### Example request to Cachet API (public read and authenticated create) Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Shows a public read request for components and an authenticated create request. The create request requires a token with `components.manage` permission. The response is in JSON:API shape with attributes from the Component resource. ```bash # Public read curl "https://status.example.com/api/components?filter[enabled]=1&include=group&per_page=20" # Authenticated create (token must hold components.manage) curl -X POST "https://status.example.com/api/components" \ -H "Authorization: Bearer " \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{"name":"API","status":1,"component_group_id":2}' # Response (JSON:API shape, attributes from the Component resource) # {"data":{"id":1,"type":"component","attributes":{...},"relationships":{...}}} ``` -------------------------------- ### Usage example for CreateComponentRequestData Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/data.md Shows how to validate and create component request data using CreateComponentRequestData::validateAndCreate and then handle it with the CreateComponent action. ```php use Cachet\Data\Requests\Component\CreateComponentRequestData; $data = CreateComponentRequestData::validateAndCreate([ 'name' => 'API', 'description' => 'The public API', 'status' => 1, 'component_group_id' => 2, ]); $component = app(CreateComponent::class)->handle($data); ``` -------------------------------- ### Example: Directly invoking a controller action Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/api-controllers.md Shows how to directly exercise a controller action by resolving the controller from the container and passing the action dependency. Typically reached over HTTP, but this allows direct invocation. ```php use Cachet\Http\Controllers\Api\ComponentController; // Typically reached over HTTP. Controllers are container-resolved, so the // action dependency can be exercised directly: $component = $controller->store($data, app(\Cachet\Actions\Component\CreateComponent::class)); ``` -------------------------------- ### GET /api/status Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Retrieves the current system status. ```APIDOC ## GET /api/status ### Description Returns the current operational status of the system. ### Method GET ### Endpoint /api/status ### Response #### Success Response (200) - **data** (object) - Contains the status and a descriptive message. ``` -------------------------------- ### Query enabled components with operational status Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/models-core.md Example of querying enabled components with operational status and printing their effective status. ```php $enabled = Component::query()->enabled()->status(ComponentStatusEnum::operational)->get(); foreach ($enabled as $component) { echo $component->latest_status->value; // effective status } ``` -------------------------------- ### Retrieve user model instance using Cachet::userModel() Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/models-incident.md Shows how to get the user model class and query for the first admin user. ```php $user = Cachet::userModel(); $admin = $user::query()->where('is_admin', true)->first(); ``` -------------------------------- ### GET / Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Displays the main status page. This is a public endpoint. ```APIDOC ## GET / ### Description Displays the main status page. ### Method GET ### Endpoint / ### Response #### Success Response (200) - **body** (HTML) - The status page content. #### Response Example ```html ... ``` ``` -------------------------------- ### GET /api/metrics Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Lists all metrics. Supports filters, includes, and sorting. ```APIDOC ## GET /api/metrics ### Description List all metrics. ### Method GET ### Endpoint /api/metrics ### Parameters #### Query Parameters - **name** (string) - Optional - Filter by name. - **calc_type** (string) - Optional - Filter by calculation type. - **tags** (string) - Optional - Filter by tags. - **include** (string) - Optional - Include related resources (e.g., `points`). - **sort** (string) - Optional - Sort by `name`, `order`, or `id`. ### Response #### Success Response (200) List of metrics. ``` -------------------------------- ### GET /schedules/{schedule} Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Displays a specific schedule. Returns 404 when the schedule is unpublished. ```APIDOC ## GET /schedules/{schedule} ### Description Displays a specific schedule. Returns 404 when the schedule is unpublished. ### Method GET ### Endpoint /schedules/{schedule} ### Parameters #### Path Parameters - **schedule** (string) - Required - The schedule identifier. ### Response #### Success Response (200) - **body** (HTML) - The schedule page content. #### Error Response (404) - **body** (HTML) - Not found page when schedule is unpublished. #### Response Example ```html ... ``` ``` -------------------------------- ### Querying incidents with viewableBy Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/models-incident.md Example of querying incidents using the viewableBy scope and accessing incident properties. ```php use Cachet\Models\Incident; $incident = Incident::query() ->viewableBy(false) ->with(['updates', 'components']) ->first(); echo $incident->guid; // uuid echo $incident->formattedMessage(); // rendered markdown $payload = $incident->toWebhookArray(); // private_note removed ``` -------------------------------- ### GET /api/version Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Retrieves the current version of the Cachet API. ```APIDOC ## GET /api/version ### Description Returns the current version of the Cachet installation. ### Method GET ### Endpoint /api/version ### Response #### Success Response (200) - **data** (object) - Contains the version string. ``` -------------------------------- ### GET /api/schedules Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Lists all schedules. Supports filters, includes, and sorting. ```APIDOC ## GET /api/schedules ### Description List all schedules. ### Method GET ### Endpoint /api/schedules ### Parameters #### Query Parameters - **name** (string) - Optional - Filter by name. - **status** (string) - Optional - Filter by status. - **meta[key]** (string) - Optional - Filter by meta key. - **tags** (string) - Optional - Filter by tags. - **include** (string) - Optional - Include related resources (e.g., `components`, `components.group`, `updates`, `meta`, `tags`). - **sort** (string) - Optional - Sort by `name`, `id`, `scheduled_at`, or `completed_at`. ### Response #### Success Response (200) List of schedules. ``` -------------------------------- ### GET /subscribe Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Displays the subscription form. Returns 404 when subscriptions are disabled. ```APIDOC ## GET /subscribe ### Description Displays the subscription form. Returns 404 when subscriptions are disabled. ### Method GET ### Endpoint /subscribe ### Response #### Success Response (200) - **body** (HTML) - The subscription form page. #### Error Response (404) - **body** (HTML) - Not found page when subscriptions are disabled. #### Response Example ```html ... ``` ``` -------------------------------- ### GET /components/{component}/badge.svg Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Returns a badge image for a specific component in SVG format. ```APIDOC ## GET /components/{component}/badge.svg ### Description Returns a badge image for a specific component in SVG format. ### Method GET ### Endpoint /components/{component}/badge.svg ### Parameters #### Path Parameters - **component** (string) - Required - The component identifier. ### Response #### Success Response (200) - **body** (image/svg+xml) - The component badge SVG image. #### Response Example ```svg ... ``` ``` -------------------------------- ### SendBeaconJob class definition Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/events.md Defines the SendBeaconJob class with a handle method. The job POSTs anonymous install data to https://cachethq.io/beacon when config('cachet.beacon') is true, and dispatches BeaconSent on success. ```php class SendBeaconJob { public function handle(): void } ``` -------------------------------- ### Cachet::path() - Get URI path prefix Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/cachet.md Returns the URI path prefix where Cachet is mounted, from config('cachet.path', '/status'). ```php public static function path(): string ``` -------------------------------- ### GET /subscribers/verify/{subscriber}/{hash} Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Verifies a subscriber's email address using a signed hash. Requires a valid signature and is rate limited. ```APIDOC ## GET /subscribers/verify/{subscriber}/{hash} ### Description Verifies a subscriber's email address using a signed hash. Requires a valid signature and is rate limited. ### Method GET ### Endpoint /subscribers/verify/{subscriber}/{hash} ### Parameters #### Path Parameters - **subscriber** (string) - Required - The subscriber identifier. - **hash** (string) - Required - The verification hash. ### Response #### Success Response (200) - **body** (HTML) - The verification result page. #### Response Example ```html ... ``` ``` -------------------------------- ### Using TwigRenderer to render a template Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/view.md Example of using the TwigRenderer service to render a simple template with variables. The render method is called with a template string and an array of variables. ```php use Cachet\Renderers\TwigRenderer; $html = app(TwigRenderer::class)->render('Hello {{ name }}', ['name' => 'world']); ``` -------------------------------- ### Cachet::getResourceApiAbilities() - Get API resource abilities Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/cachet.md Returns an associative array of every API resource and the abilities a Sanctum token must hold to mutate it. ```php public static function getResourceApiAbilities(): array ``` ```php [ 'components' => ['manage', 'delete'], 'component-groups' => ['manage', 'delete'], 'incidents' => ['manage', 'delete'], 'incident-updates' => ['manage', 'delete'], 'incident-templates' => ['manage', 'delete'], 'metrics' => ['manage', 'delete'], 'metric-points' => ['manage', 'delete'], 'schedules' => ['manage', 'delete'], 'schedule-updates' => ['manage', 'delete'], 'subscribers' => ['manage', 'delete'], ] ``` -------------------------------- ### GET /api/ping Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Checks if the API is reachable. ```APIDOC ## GET /api/ping ### Description Returns a simple pong response to verify API connectivity. ### Method GET ### Endpoint /api/ping ### Response #### Success Response (200) - **data** (string) - The string "Pong!" ``` -------------------------------- ### Using MailSettings to update from_address Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/settings.md Shows how to retrieve the MailSettings instance and update the from_address property, then save. ```php use Cachet\Settings\MailSettings; $settings = app(MailSettings::class); $settings->from_address = 'status@example.com'; $settings->save(); ``` -------------------------------- ### Run cachet:make:user command Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/commands.md Executes the cachet:make:user Artisan command with all options provided to create a user non-interactively. ```bash php artisan cachet:make:user admin@example.com --password=secret --admin=true --name="Admin" ``` -------------------------------- ### GET /api/schedules/{schedule} Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Retrieves a single schedule by ID. ```APIDOC ## GET /api/schedules/{schedule} ### Description Get a specific schedule. ### Method GET ### Endpoint /api/schedules/{schedule} ### Parameters #### Path Parameters - **schedule** (integer) - Required - The schedule ID. ### Response #### Success Response (200) Schedule object. ``` -------------------------------- ### GET /api/metrics/{metric} Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Retrieves a single metric by ID. ```APIDOC ## GET /api/metrics/{metric} ### Description Get a specific metric. ### Method GET ### Endpoint /api/metrics/{metric} ### Parameters #### Path Parameters - **metric** (integer) - Required - The metric ID. ### Response #### Success Response (200) Metric object. ``` -------------------------------- ### boot() method signature Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/service-providers.md Public method signature for the boot() method in CachetCoreServiceProvider. It merges configuration, configures trusted proxies, registers middleware groups, morph map, commands, schedules, resources, publishing, Blade components, mail config, and event listeners. ```php public function boot(): void ``` -------------------------------- ### Private tally() method signature Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/status.md Backs components(). Groups enabled components by their status column, then moves those with impacts into effective buckets. ```php private function tally(): object ``` -------------------------------- ### BadgeResponseFactory methods Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/web.md Provides methods to create badge responses and determine the badge style. The make method returns a 200 response with Cache-Control public max-age/s-maxage 60 and image/svg+xml. The style method reads the 'style' query parameter, whitelisting flat-square, plastic-flat, flat, plastic, social, and svg, defaulting to flat-square. ```php public function make(BadgeImage $badge): Response // 200, Cache-Control public max-age/s-maxage 60, image/svg+xml public function style(Request $request): string // 'style' query param; whitelist flat-square|plastic-flat|flat|plastic|social|svg, default flat-square ``` -------------------------------- ### Command signature and description for cachet:make:user Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/commands.md Defines the signature and description for the cachet:make:user command. Creates a user on config('cachet.user_model'). Each missing value is prompted for interactively (name, email, admin confirmation defaulting to false, password). Returns Command::SUCCESS. ```plaintext signature: cachet:make:user {email?} {--password= : The user's password} {--admin= : Whether the user is an admin} {--name= : The name of the user } description: "Create a new user" ``` -------------------------------- ### current() method signature Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/status.md Returns the current system status as a SystemStatusEnum. Resolution order: majorOutage, underMaintenance, operational if all components operational and no unresolved incidents, otherwise partial_outage. ```php public function current(): SystemStatusEnum ``` -------------------------------- ### GET /health Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Returns a plain 'OK' response indicating the service is healthy. ```APIDOC ## GET /health ### Description Returns a plain 'OK' response indicating the service is healthy. ### Method GET ### Endpoint /health ### Response #### Success Response (200) - **body** (text/plain) - The string `OK`. #### Response Example ```text OK ``` ``` -------------------------------- ### Run cachet:assets command Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/commands.md Executes the cachet:assets Artisan command to publish Cachet's assets. ```bash php artisan cachet:assets ``` -------------------------------- ### Query and interact with ComponentGroup and Component Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/models-core.md Fetches a component group with its components, sorts them by the group's order, and demonstrates using HasMeta, HasTags, and checks methods. ```php use Cachet\Models\Component; use Cachet\Models\ComponentGroup; $group = ComponentGroup::query()->with('components')->find(1); foreach ($group->components->sortBy(fn ($c) => $c->orderableBy($group)) as $component) { echo $component->name.' => '.$component->latest_status->getLabel(); } $component->syncMeta(['cluster' => 'eu-west']); // from HasMeta $component->syncTags(['api', 'database']); // from HasTags $component->checks()->create([ 'status' => ComponentStatusEnum::operational, 'successful' => true, 'response_code' => 200, 'checked_at' => now(), ]); ``` -------------------------------- ### GET /api/subscribers/{subscriber} Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Retrieves a single subscriber. Requires the `subscribers.manage` ability. ```APIDOC ## GET /api/subscribers/{subscriber} ### Description Get a specific subscriber. ### Method GET ### Endpoint /api/subscribers/{subscriber} ### Authentication Requires ability: `subscribers.manage` ### Parameters #### Path Parameters - **subscriber** (integer) - Required - The subscriber ID. ### Response #### Success Response (200) Subscriber object. ``` -------------------------------- ### GET /api/schedules/{schedule}/updates/{update} Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Retrieves a single schedule update. ```APIDOC ## GET /api/schedules/{schedule}/updates/{update} ### Description Get a specific schedule update. ### Method GET ### Endpoint /api/schedules/{schedule}/updates/{update} ### Parameters #### Path Parameters - **schedule** (integer) - Required - The schedule ID. - **update** (integer) - Required - The update ID. ### Response #### Success Response (200) Schedule update object. ``` -------------------------------- ### GET /api/metrics/{metric}/points/{metric_point} Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Retrieves a single metric point. ```APIDOC ## GET /api/metrics/{metric}/points/{metric_point} ### Description Get a specific metric point. ### Method GET ### Endpoint /api/metrics/{metric}/points/{metric_point} ### Parameters #### Path Parameters - **metric** (integer) - Required - The metric ID. - **metric_point** (integer) - Required - The metric point ID. ### Response #### Success Response (200) Metric point object. ``` -------------------------------- ### SubscriberController create and store signatures Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/web.md create() renders the subscribe form, aborting 404 unless subscribers are allowed or a cachet_subscriber_status session flag exists. store() validates email (required, email, max:255), creates the subscriber via CreateSubscriber, sends verification email when unverified, and redirects back with a cachet_subscriber_status flash. ```php public function create(MailSettings $mailSettings): View public function store(Request $request, MailSettings $mailSettings, CreateSubscriber $createSubscriber): RedirectResponse ``` -------------------------------- ### Artisan vendor:publish commands Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/service-providers.md Commands to publish Cachet configuration, views, and assets. Use the appropriate tag to publish specific resources. ```bash php artisan vendor:publish --tag=cachet php artisan vendor:publish --tag=cachet-config php artisan vendor:publish --tag=cachet-views php artisan vendor:publish --tag=cachet-assets ``` -------------------------------- ### GET /api/subscribers Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Lists all subscribers. Requires the `subscribers.manage` ability. Supports filters, includes, and sorting. ```APIDOC ## GET /api/subscribers ### Description List all subscribers. ### Method GET ### Endpoint /api/subscribers ### Authentication Requires ability: `subscribers.manage` ### Parameters #### Query Parameters - **email** (string) - Optional - Filter by email. - **global** (boolean) - Optional - Filter by global subscription. - **meta[key]** (string) - Optional - Filter by meta key. - **include** (string) - Optional - Include related resources (e.g., `components`, `meta`). - **sort** (string) - Optional - Sort by `email` or `id`. ### Response #### Success Response (200) List of subscribers. ``` -------------------------------- ### Register Cachet service providers in bootstrap/providers.php Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/service-providers.md Lists the service providers in the main cachethq/cachet repository's bootstrap/providers.php, including AppServiceProvider and the two Cachet providers. ```php // bootstrap/providers.php (cachethq/cachet) return [ AppServiceProvider::class, Cachet\CachetCoreServiceProvider::class, Cachet\CachetDashboardServiceProvider::class, ]; ``` -------------------------------- ### Register and render a render hook with CachetView Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/cachet.md Shows how to use the CachetView facade to register a render hook for 'cachet::footer' and then render it. The hook is deferred until the ViewManager is resolved. ```php use Cachet\Facades\CachetView; CachetView::registerRenderHook('cachet::footer', fn () => view('my-footer')); echo CachetView::renderHook('cachet::footer'); ``` -------------------------------- ### Use ComponentResource in a controller Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/http-resources.md Shows how to return a single Component resource with a 200 status code, or a collection of components. Requires importing the ComponentResource and Component model. ```php use Cachet\Http\Resources\Component as ComponentResource; use Cachet\Models\Component; // Inside a controller: return ComponentResource::make($component) ->response() ->setStatusCode(200); return ComponentResource::collection($components); // paginated or collection ``` -------------------------------- ### GET /api/schedules/{schedule}/updates Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Lists schedule updates for a specific schedule. Supports includes and sorting. ```APIDOC ## GET /api/schedules/{schedule}/updates ### Description List schedule updates. ### Method GET ### Endpoint /api/schedules/{schedule}/updates ### Parameters #### Path Parameters - **schedule** (integer) - Required - The schedule ID. #### Query Parameters - **include** (string) - Optional - Include related resources (e.g., `schedule`). - **sort** (string) - Optional - Sort by `created_at`. ### Response #### Success Response (200) List of schedule updates. ``` -------------------------------- ### GET /api/metrics/{metric}/points Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Lists metric points for a specific metric. Supports includes and sorting. ```APIDOC ## GET /api/metrics/{metric}/points ### Description List metric points. ### Method GET ### Endpoint /api/metrics/{metric}/points ### Parameters #### Path Parameters - **metric** (integer) - Required - The metric ID. #### Query Parameters - **include** (string) - Optional - Include related resources (e.g., `metric`). - **sort** (string) - Optional - Sort by `id`, `value`, or `created_at`. ### Response #### Success Response (200) List of metric points. ``` -------------------------------- ### User model methods: canAccessPanel, isAdmin, preferredLocale Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/models-incident.md Shows the three key methods of the User model: canAccessPanel always returns true, isAdmin returns the is_admin attribute, and preferredLocale returns the preferred_locale attribute. ```php public function canAccessPanel(Panel $panel): bool // always true public function isAdmin(): bool // returns $this->is_admin public function preferredLocale() // returns $this->preferred_locale ``` -------------------------------- ### GET /slack.rss Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Returns an RSS feed formatted for Slack. Rate limited to 60 requests per minute. ```APIDOC ## GET /slack.rss ### Description Returns an RSS feed formatted for Slack. Rate limited to 60 requests per minute. ### Method GET ### Endpoint /slack.rss ### Response #### Success Response (200) - **body** (application/rss+xml) - The Slack RSS feed. #### Response Example ```xml ... ``` ``` -------------------------------- ### GET /rss Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Returns an RSS feed of incidents and updates. Rate limited to 60 requests per minute. ```APIDOC ## GET /rss ### Description Returns an RSS feed of incidents and updates. Rate limited to 60 requests per minute. ### Method GET ### Endpoint /rss ### Response #### Success Response (200) - **body** (application/rss+xml) - The RSS feed. #### Response Example ```xml ... ``` ``` -------------------------------- ### Command signature and description for cachet:assets Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/commands.md Defines the signature and description for the cachet:assets command. Copies the package's public directory to public_path('vendor/cachethq/cachet') and prints 'Cachet assets published.' Returns Command::SUCCESS. ```plaintext signature: cachet:assets description: "Publish Cachet's assets" ``` -------------------------------- ### underMaintenance() method signature Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/status.md Returns true when at least one enabled component is under maintenance, false when there are no components. ```php public function underMaintenance(): bool ``` -------------------------------- ### GET /badge.svg Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Returns a badge image in SVG format. The style can be customized via the `style` query parameter. ```APIDOC ## GET /badge.svg ### Description Returns a badge image in SVG format. The style can be customized via the `style` query parameter. ### Method GET ### Endpoint /badge.svg ### Parameters #### Query Parameters - **style** (string) - Optional - One of `flat-square`, `plastic-flat`, `flat`, `plastic`, `social`, `svg`. ### Response #### Success Response (200) - **body** (image/svg+xml) - The badge SVG image. #### Response Example ```svg ... ``` ``` -------------------------------- ### Resolve and invoke CreateComponent action Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/actions.md Shows how to resolve the CreateComponent action from the container and call its handle() method with data. Constructor dependencies are injected automatically. ```php use Cachet\Actions\Component\CreateComponent; $component = app(CreateComponent::class)->handle($data); ``` -------------------------------- ### GET /subscribers/unsubscribe/{subscriber}/{hash} Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Displays the unsubscribe confirmation page for a subscriber. Requires a valid signature and is rate limited. ```APIDOC ## GET /subscribers/unsubscribe/{subscriber}/{hash} ### Description Displays the unsubscribe confirmation page for a subscriber. Requires a valid signature and is rate limited. ### Method GET ### Endpoint /subscribers/unsubscribe/{subscriber}/{hash} ### Parameters #### Path Parameters - **subscriber** (string) - Required - The subscriber identifier. - **hash** (string) - Required - The unsubscribe hash. ### Response #### Success Response (200) - **body** (HTML) - The unsubscribe confirmation page. #### Response Example ```html ... ``` ``` -------------------------------- ### Subscriber model methods Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/models-incident.md Lists the key methods for the Subscriber model, including relations, scopes, verification, and unsubscribe URL generation. ```php public function components(): BelongsToMany // via 'subscriptions' public function sendEmailVerificationNotification(): void // notifies VerifySubscriberEmail public function scopeVerified(Builder $query): Builder public function scopeSubscribedTo(Builder $query, Incident|Schedule $resource): Builder // global OR subscribed to a resource's components public function unsubscribeUrl(): string // signed route cachet.subscribers.unsubscribe with sha1(email) hash public function resetVerification(): void public function verify(): void // marks verified and dispatches SubscriberVerified ``` -------------------------------- ### GET /api/components Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Public read endpoint to list components with optional filters and includes. This endpoint is used to retrieve component data. ```APIDOC ## GET /api/components ### Description Public read endpoint to list components with optional filters and includes. ### Method GET ### Endpoint /api/components ### Parameters #### Query Parameters - **filter[enabled]** (integer) - Optional - Filter by enabled status (1 for enabled). - **include** (string) - Optional - Include related resources (e.g., group). - **per_page** (integer) - Optional - Number of results per page. ### Request Example ```bash curl "https://status.example.com/api/components?filter[enabled]=1&include=group&per_page=20" ``` ### Response #### Success Response (200) - **data** (array) - List of component resources. #### Response Example ```json {"data":[{"id":1,"type":"component","attributes":{},"relationships":{}}]} ``` ``` -------------------------------- ### POST /api/components Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Authenticated create endpoint to create a new component. Requires a bearer token with components.manage permission. ```APIDOC ## POST /api/components ### Description Authenticated create endpoint to create a new component. Requires a bearer token with components.manage permission. ### Method POST ### Endpoint /api/components ### Parameters #### Request Body - **name** (string) - Required - Name of the component. - **status** (integer) - Required - Status code of the component. - **component_group_id** (integer) - Optional - ID of the component group. ### Request Example ```json {"name":"API","status":1,"component_group_id":2} ``` ### Response #### Success Response (201) - **data** (object) - The created component resource. #### Response Example ```json {"data":{"id":1,"type":"component","attributes":{},"relationships":{}}} ``` ``` -------------------------------- ### Run cachet:check command Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/commands.md Executes the cachet:check Artisan command, which dispatches the component-check jobs to the queue. ```bash php artisan cachet:check # dispatches the component-check jobs to the queue ``` -------------------------------- ### GET /verify-email/{id}/{hash} Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Verifies a user's email address. Requires authentication, a valid signature, and is rate limited. ```APIDOC ## GET /verify-email/{id}/{hash} ### Description Verifies a user's email address. Requires authentication, a valid signature, and is rate limited. ### Method GET ### Endpoint /verify-email/{id}/{hash} ### Parameters #### Path Parameters - **id** (string) - Required - The user identifier. - **hash** (string) - Required - The verification hash. ### Response #### Success Response (200) - **body** (HTML) - The verification result page. #### Response Example ```html ... ``` ``` -------------------------------- ### Command signature and description for cachet:check Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/commands.md Defines the signature and description for the cachet:check command. Dispatches a Cachet\Jobs\CheckComponent job for every enabled component that is checked and has a non-null link. Returns Command::SUCCESS. ```plaintext signature: cachet:check description: "Check the status of all components." ``` -------------------------------- ### Dispatch CheckComponent job Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/events.md Shows how to dispatch the CheckComponent job using the static dispatch method with a component instance. ```php use Cachet\Jobs\CheckComponent; CheckComponent::dispatch($component); ``` -------------------------------- ### Register and render a render hook with ViewManager Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/view.md Shows how to register a render hook for the 'cachet::footer' name and then render it. The hook returns a custom HTML string, and renderHook outputs the concatenated result. ```php use Cachet\View\ViewManager; app(ViewManager::class)->registerRenderHook('cachet::footer', fn () => '

Custom footer

'); echo app(ViewManager::class)->renderHook('cachet::footer'); ``` -------------------------------- ### Cachet::userModel() - Get new user model instance Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/cachet.md Returns a new instance of the configured user model (default App\Models\User). No parameters. ```php public static function userModel(): Model ``` ```php $userModel = Cachet::userModel(); $user = $userModel::query()->where('email', $email)->first(); ``` -------------------------------- ### Cachet::demoMode() - Check demo mode Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/cachet.md Returns (bool) config('cachet.demo_mode'). Used by the scheduler to seed demo data periodically. ```php public static function demoMode(): bool ``` -------------------------------- ### register() method signature Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/service-providers.md Public method signature for the register() method in CachetCoreServiceProvider. It defines the CACHET_PATH constant, binds Cachet, ViewManager, and Status, registers BadgerServiceProvider, and calls configureSettingsCache(). ```php public function register(): void ``` -------------------------------- ### StatusPageController constructor and method signatures Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/web.md Defines the constructor and public methods for the status page controller. The index method renders the status page with published incomplete schedules and the display_graphs flag. The show method aborts with 404 unless the incident is viewable, and the schedule method aborts with 404 when unpublished and not authenticated. ```php public function __construct(protected AppSettings $appSettings) {} public function index(): View public function show(Incident $incident): View public function schedule(Schedule $schedule): View ``` -------------------------------- ### Cachet::dashboardPath() - Get dashboard URI path Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/cachet.md Returns the URI path of the dashboard, defaulting to the join of the Cachet path and 'dashboard' (e.g., /status/dashboard). ```php public static function dashboardPath(): string ``` -------------------------------- ### POST /api/schedules Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Creates a new schedule. Requires the `schedules.manage` ability. ```APIDOC ## POST /api/schedules ### Description Create a new schedule. ### Method POST ### Endpoint /api/schedules ### Authentication Requires ability: `schedules.manage` ### Parameters #### Request Body Refer to CreateScheduleRequestData. ### Response #### Success Response (201) Created schedule. ``` -------------------------------- ### current() Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/status.md Returns the current system status as a SystemStatusEnum value. Resolution order: major outage, under maintenance, operational if all components operational and no unresolved incidents, otherwise partial outage. ```APIDOC ## current() ### Description Returns the current system status as a `Cachet\Enums\SystemStatusEnum` value. Resolution order: major outage, under maintenance, operational if all components operational and no unresolved incidents, otherwise partial outage. ### Method current() ### Signature ```php public function current(): SystemStatusEnum ``` ### Returns - **SystemStatusEnum** - One of `operational`, `partial_outage`, `major_outage`, `under_maintenance`. ### Usage Example ```php use Cachet\Status; $status = app(Status::class); echo $status->current()->value; // e.g. "operational" echo $status->current()->getLabel(); // e.g. "All Systems Operational" ``` ``` -------------------------------- ### CreateScheduleRequestData constructor Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/data.md Constructor for creating a schedule. Requires name and message strings, and scheduledAt as a required Carbon with FlexibleDateTimeCast. Optional completedAt and publishedAt are nullable Carbon with cast. notifications defaults to false. components is nullable array of ScheduleComponentRequestData with DataCollectionOf. tags is array, meta is nullable array. ```php public function __construct( public readonly string $name, public readonly string $message, #[WithCast(FlexibleDateTimeCast::class)] public readonly Carbon $scheduledAt, #[WithCast(FlexibleDateTimeCast::class)] public readonly ?Carbon $completedAt = null, #[WithCast(FlexibleDateTimeCast::class)] public readonly ?Carbon $publishedAt = null, public readonly bool $notifications = false, #[DataCollectionOf(ScheduleComponentRequestData::class)] public readonly ?array $components = null, public readonly array $tags = [], public readonly ?array $meta = null, ) {} ``` -------------------------------- ### AppSettings class definition Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/settings.md Defines the AppSettings class extending Settings, with public typed properties and defaults. The group() method returns 'app' for persistence. ```php class AppSettings extends Settings { public string $install_id; public ?string $name = 'Cachet'; public ?string $about; public bool $show_site_name = false; public bool $show_about = true; public bool $show_support = true; public string $locale = 'en'; public string $timezone = 'UTC'; public bool $show_timezone = false; public bool $only_disrupted_days = false; public int $incident_days = 7; public ?int $refresh_rate; public bool $dashboard_login_link = true; public int $major_outage_threshold = 25; public bool $recent_incidents_only = false; public int $recent_incidents_days = 7; public bool $display_graphs = true; public bool $enable_external_dependencies = true; public bool $api_enabled = true; public bool $api_protected = false; public bool $mcp_enabled = false; public bool $mcp_protected = true; public bool $dynamic_favicon = false; public bool $show_component_group_status = true; public bool $show_component_tags = false; public bool $display_system_status = false; public static function group(): string // 'app' } ``` -------------------------------- ### GeneralController methods: ping and version Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/api-controllers.md Defines the ping and version methods of GeneralController. The ping method returns a JSON response with 'Pong!', and the version method returns the Cachet version. No authentication is required. ```php public function ping(): JsonResponse // {'data': 'Pong!'} public function version(): JsonResponse // {'data': {'version': Cachet::version()}} ``` -------------------------------- ### POST /api/metrics/{metric}/points Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/endpoints.md Creates a new metric point. Requires the `metric-points.manage` ability. ```APIDOC ## POST /api/metrics/{metric}/points ### Description Create a metric point. ### Method POST ### Endpoint /api/metrics/{metric}/points ### Authentication Requires ability: `metric-points.manage` ### Parameters #### Path Parameters - **metric** (integer) - Required - The metric ID. #### Request Body - **value** (float) - Required - The point value. - **timestamp** (date|unix) - Optional - The timestamp of the point. ### Response #### Success Response (201) Created metric point. ``` -------------------------------- ### CheckComponent class definition Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/events.md Defines the CheckComponent job that implements ShouldQueue and uses standard queue traits. The handle method is empty in the snippet, but the job performs an HTTP GET on the component's link with Cachet::USER_AGENT, a 3-second timeout, and retries with back-off. It updates component status unless under maintenance. ```php class CheckComponent implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; public function __construct(public Component $component) {} public function handle(): void } ``` -------------------------------- ### Component::formattedDescription() method Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/models-core.md Renders the Markdown description inline using Cachet::markdown(). ```php public function formattedDescription(): string ``` -------------------------------- ### components() method signature Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/status.md Returns an object tally of enabled components by their effective status (incident impacts and maintenance windows applied). ```php public function components(): object ``` -------------------------------- ### CreateMetricPointRequestData constructor Source: https://github.com/cachethq/cachet/blob/3.x/_autodocs/api-reference/data.md Constructor for creating a metric point. Requires value as a numeric float. Optional timestamp is nullable Carbon with FlexibleDateTimeCast, validated by ValidTimestamp (date or Unix timestamp). ```php public function __construct( public readonly float $value, #[WithCast(FlexibleDateTimeCast::class)] public readonly ?Carbon $timestamp = null, ) {} ```