Download the PHP package mirafive/sdk-laravel without Composer

On this page you can find all versions of the php package mirafive/sdk-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk-laravel

MIRA FIVE for Laravel

Privacy-first analytics and feature flags for Laravel, hosted in the EU: track business events from your controllers and jobs, evaluate flags in-process, and add the website tracker with one Blade directive. Events are sent after the response, so your pages never wait for analytics.

Install

PHP 8.3+, Laravel 11, 12 or 13. The service provider and the Mira facade are discovered automatically. To change the defaults, publish the configuration:

Quickstart

Create a server source and a website source in MIRA FIVE and put their keys in .env:

Track from a controller:

Identify after login, with the user's internal id and a few traits:

Mira::forUser($request->user()) fills in getAuthIdentifier() as the user id for track(), identify() and flags().

Add the tracker to your layout's <head>:

It prints the hosted script with your website key, data-mode="full" when MIRAFIVE_SCRIPT_MODE=full (plus data-host when you use your own host), and a Vite CSP nonce when one is set. More tracker attributes go in as an array:

Verify the setup:

It sends a $install_check event (never stored or billed) and prints the receipt.

Consent & privacy

MIRA FIVE has two collection modes, full and consentless, set separately for server events (MIRAFIVE_MODE, default full) and for the tracker (MIRAFIVE_SCRIPT_MODE, default consentless):

Rules for both modes:

Configuration

Key Env Default
enabled MIRAFIVE_ENABLED true Off, or without a secret key: nothing is sent and no key is needed, flags answer their fallbacks. Off also omits the tracker tag
secret_key MIRAFIVE_SECRET_KEY — Secret key of a server source
website_key MIRAFIVE_WEBSITE_KEY — Public key of a website source, for @mirafiveScript
host MIRAFIVE_HOST https://events.mirafive.io Collector, with scheme
mode MIRAFIVE_MODE full Server events: full or consentless
script_mode MIRAFIVE_SCRIPT_MODE consentless The tracker from @mirafiveScript: consentless or full
queue MIRAFIVE_QUEUE null null sends after the response; mirafive or redis:mirafive (connection:queue) dispatches a job per batch
script_url MIRAFIVE_SCRIPT_URL https://cdn.mirafive.io/mira.js Tracker script, e.g. a self-hosted copy
flags.refresh_seconds MIRAFIVE_FLAGS_REFRESH 30 How old the flag document may get (at least 10)
flags.cache_store MIRAFIVE_FLAGS_CACHE default store Laravel cache store that shares the flag document between requests

Delivery failures go to your default log channel as warnings. MiraFive\Mira and MiraFive\Flags\MiraFlags can be injected directly; to send through your own HTTP client, bind MiraFive\Http\Transport (e.g. to MiraFive\Http\Psr18Transport) before they are resolved.

Queues & Octane

When events are sent. track() and identify() buffer. The buffer is sent once, when Laravel terminates (after the response under PHP-FPM), after each Octane request, task and tick, and after each queued job; the core's own shutdown flush is switched off. Every 100 events it is sent early. send() is always immediate.

Queued delivery. With MIRAFIVE_QUEUE set, each buffered batch is encoded once and handed to a MiraFive\Laravel\Queue\SendBatch job, so the request does not wait for MIRA FIVE at all. The job carries the body, never the key: the worker sends it with its own configuration. The body is final and keeps its batch id, so a job that runs twice is stored once. Retryable failures are retried by the queue (5 tries, backoff up to 15 minutes); refused batches are logged and dropped. A worker without MIRAFIVE_SECRET_KEY logs an error and fails the job instead of dropping it; one with MIRAFIVE_ENABLED=false drops it quietly. Batches are up to 1 MiB of JSON (SQS allows 256 KB). send() never queues: it always sends immediately and returns the collector's receipt.

Octane. The package is safe in long-running workers: no request state is kept in singletons, and the buffer is flushed at the end of every request. It adds MiraFive\Mira, MiraFlags, the transport and the facade's client to octane.warm, so a worker keeps one HTTP connection and one flag document instead of building them per request.

Flags

Or Mira::forUser($request->user())->flags(properties: [...]), which reads the opt-out from the current request unless you pass optedOut. Reads never throw; without a document every flag answers its fallback. The document is fetched on first use and shared between requests through the cache store.

Bootstrap in Blade. Hand the server's answers to the browser SDK so the first paint shows the right variant:

The unit takes userId, anonymousId, properties, consent and optedOut (read from Sec-GPC/DNT when left out). You can also pass flags you already read: @mirafiveFlags($flags). Only flags your website reads are included, and every value is escaped so it cannot end the script.

A page carrying a bootstrap must never be stored by a shared cache. The package adds Cache-Control: private, no-store to every response whose view printed @mirafiveFlags; nothing to configure. If you print $flags->bootstrap() yourself, send the header yourself: response($html)->withHeaders(MiraFive\Flags\MiraFlags::BOOTSTRAP_HEADERS).

Testing with Mira::fake()

The fake records track(), identify() and send() through the facade and through an injected MiraFive\Laravel\Client. Input is still checked, so an event MIRA FIVE would refuse fails the test. Flags answer their fallbacks. Code that injects MiraFive\Mira directly is not faked; set MIRAFIVE_ENABLED=false in phpunit.xml so it sends nothing.

Troubleshooting

For AI agents

A prompt for an agent adding MIRA FIVE to a Laravel application:

Facts for agents:

License

MIT, see LICENSE. Copyright (c) 2026 Cloo GmbH.


All versions of sdk-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/queue Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/view Version ^11.0|^12.0|^13.0
mirafive/sdk-php Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mirafive/sdk-laravel contains the following files

Loading the files please wait ...