Skip to content
mozrin edited this page Nov 22, 2026 · 6 revisions

Moztopia Cloudflare

Welcome to the moztopia-cloudflare wiki!

moztopia/cloudflare gives Laravel applications credential-free access to trusted Cloudflare visitor information and request metadata. Use it from controllers, services and Blade without making network requests.

The wiki is the source of truth for human-facing project documentation. The root README is a brief introduction and entry point; detailed installation, configuration, API, application examples, development guidance and planning belong here. Source files, tests, version records and the license remain the implementation and legal evidence linked by this guide.

This guide describes the 0.9.0 — Cirrus runtime contract. The 0.9.1 documentation and branding update preserves that contract. The released source is the implementation authority. Future work is identified explicitly on the Roadmap.

Start here

What is available in tagged 0.9.1

The package exposes two methods:

use Moztopia\Cloudflare\Facades\Cloudflare;

$visitor = Cloudflare::visitor();
$context = Cloudflare::requestContext();

The visitor snapshot includes country, continent, region, region code, city, timezone and Cloudflare's special country markers. Request context includes accepted-ingress status, client IP, Ray ID and visitor scheme. Missing, invalid or untrusted metadata remains unknown.

The package has an auto-discovered service provider, a facade, dependency injection, publishable configuration and immutable snapshots. It resolves the active request on each read, including under long-lived Laravel workers.

Scope

The core needs no Cloudflare API token, database, scheduler or cloudflared process. Installing or reading it does not enable Cloudflare settings, alter Laravel's trusted proxies, select an application locale or create a tunnel.

Image builders and cache-policy helpers remain future work. The doctor, expanded location fields and dedicated fixtures are implemented in unreleased core work, and remain absent from tagged 0.9.1. The current package does not discover every enabled Cloudflare product or probe /cdn-cgi/trace. A future trace client would be a separate diagnostic API: a request sent by Laravel describes the server’s connection, rather than the incoming visitor.

Project links

Runtime guide established for source db0245fa49fb08a2351a453e671f73aeb286c3ab; plan verified against tagged source 0.9.1, 51efce6322f857b02f950036391ce9418df8112a, on 2026-11-21. Planning does not add runtime features. Maintained by-dolly.

Clone this wiki locally