Download the PHP package flyo/nitro-laravel without Composer

On this page you can find all versions of the php package flyo/nitro-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 nitro-laravel

Flyo Nitro Laravel Framework Module

AI coding agent instructions (Laravel integration) The file [ai-instructions-laravel.md](ai-instructions-laravel.md) contains a complete advisory for integrating Flyo Nitro CMS into an **existing Laravel project** using `flyo/nitro-laravel`. It is written to be pasted directly into a coding agent (Claude, Copilot, Cursor, etc.) as a system prompt or task description. **Copy the raw instructions:** - GitHub raw URL: `https://raw.githubusercontent.com/flyocloud/nitro-laravel/refs/heads/main/ai-instructions-laravel.md` - Or open [ai-instructions-laravel.md](ai-instructions-laravel.md) and use the **Raw** button. The advisory covers: - Package installation, `vendor:publish` and the `config/flyo.php` settings - Environment variables, access token handling and the routes which have to make way for the CMS pages - Layout integration with `` and ``, plus `Header` and `Footer` components driven by Flyo containers - The `cms.blade.php` entry view and how block views are resolved by component name - WYSIWYG and image helpers built on `Flyo\Bridge\Wysiwyg` and `Flyo\Bridge\Image` - How to discover block fields without type generation (PHP has no generated types) - A reusable Claude skill (`.claude/skills/flyo-block/SKILL.md`) for building a named block from a design or an existing Blade view - Entity detail routes, draft links, cache headers, sitemap and i18n - A final validation checklist

Usage

Requires PHP 8.3 or newer and Laravel 11, 12 or 13.

publish the config

Adjust the token in config/flyo.php

Ensure to remove the default routes in routes/web.php which could conflict with the cms routes.

Views

Add/Adjust the cms.blade.php view file in resources/views, this is where the cms page loader starts:

Now all component block views are looked up in ressources/views/flyo, for example if you have a Flyo Nitro component block with name Text the view file would be ressources/views/flyo/Text.blade.php utilizing the following variables:

You can adjust the views namespace in the config file using views_namespace key.

To make the block editable you must place the Blade directive @editable($block) on the block's root HTML element. This ensures the Flyo editor can correctly detect the block and display the edit icon next to that element when the page is opened in the editor. In short: put @editable($block) on the outermost element of the block so clicking the icon opens this block for editing.

In raw php templates, or anywhere else the blade directive is not available (a controller, a string you build yourself), use Flyo\Laravel\Editable instead:

Editable::attr($block) returns the escaped data-flyo-uid="..." attribute, or an empty string when live edit is disabled. Editable::uid($block) gives you the raw uid, Editable::isEnabled() the live edit state. The marker alone is not enough though: the javascript which makes it interactive is loaded by the <x-flyo::head /> component, so your layout has to include it.

Live Edit

With live_edit enabled in config/flyo.php, the <x-flyo::head /> component loads the nitro js bridge from the CDN and wires everything the Flyo editor needs when the site is displayed inside the editor preview iframe:

The hover affordance appears after roughly half a second of hovering, so it does not flicker while the mouse crosses the page. It is drawn in a single overlay element outside of your markup: no styles, classes, attributes or listeners are added to your elements and layout and scrolling are untouched. On the live site nothing of it is loaded at all, since live_edit is disabled there.

The bridge url is pinned to the major version, so bridge releases are picked up automatically. To self host it or to pin an exact version, set the url in config/flyo.php:

Layout Variable

In order to build menus, the $config response from the api is a global available variable, for example this could be used in layout-components:

Make sure to include the <x-flyo::head> component in the head of your layout file, for example

This will add needed javascript for reloading and editin blocks in local environments and also assign all available meta informations.

The meta informations are taken from the api response of the current page (or entity when using the EntityController), which includes the title, description, image and the schema.org json-ld object rendered as an application/ld+json script.

A full layout example which could be placed in resources/views/layouts/app.blade.php:

Entity Detail

To display an entity detail page, you have to register a route, create a controller and a view file:

Routing File example

The Controller:

And the example tier.blade.php in the resources/views folder:

There is also a more generic controller available which can be used to display any entity detail page:

where the poi.blade.php file in the resources/views folder could look like this:

Search Engine Indexing

Pages and entities carry an is_indexable flag (flyo/nitro-php 3.2). When the api marks a document as not indexable, Head::metaPage() and Head::metaEntity() render a robots meta tag in the head:

This is not access control, the page or the entity still resolves like any other, it is only kept out of the search engines (and out of the sitemap and the search endpoint on the api side). A draft entity is always flagged as not indexable, see Draft Links.

The flag can also be set by hand, for a page which the application itself wants to hide:

Call it after metaPage() / metaEntity(), those assign the flag from the api response and would otherwise reset it.

Cache Headers

Flyo\Laravel\Middleware\CachingHeaders is applied to the CMS page routes and the sitemap. It writes one header for the browser and the two cdn specific ones which take precedence on the edge:

The stale-while-revalidate window is what keeps the origin quiet around an expiry: without it the moment an edge entry expires turns into an origin request for every visitor waiting on that url at that moment, with it the edge keeps answering from the stale copy and refreshes itself with a single background request. It is configured with server_cache_stale_while_revalidate_ttl, which defaults to 450 seconds (half of the default server_cache_ttl). Nothing has to be changed to get that behavior, set it to 0 to send max-age alone:

A visitor can therefore be served a page which is up to server_cache_ttl + server_cache_stale_while_revalidate_ttl seconds old, but only until the background refresh of the first request after the expiry has finished.

Set server_cache_ttl or client_cache_ttl to 0 to opt out of that layer, a server_cache_ttl of 0 sends no-store to the edge and never carries a stale window. Caching is switched off entirely when flyo.live_edit is enabled or APP_DEBUG is on, and a non successful response is not cached either. Flyo\Laravel\Middleware\CachingHeaders::cdnCacheControl($ttl, $staleTtl) builds the value of the cdn headers, in case an application writes them somewhere else too.

Add the middleware to a hand written route which serves CMS content and should be cached the same way:

Draft Links

A draft link is a shareable, expiring snapshot of an entity which is still offline in Flyo. It is requested through the regular entity endpoints, with a draft token in place of the slug or the unique id, and the api answers with is_draft set and a draft_expires_at timestamp:

Two things a route serving draft links has to respect:

  1. The token does not look like a slug or a unique id, so a parameter pattern (->where(...)) has to let it through.
  2. The entity type id does not apply to a token, so resolve without it:

A draft response is never cached

Once an entity was delivered through a draft link, the package makes the whole response uncacheable, for the client and for a cdn or another server side cache alike:

ETag and Last-Modified are dropped as well, and the server_cache_ttl / client_cache_ttl config is ignored for such a response. The draft snapshot is rewritten with every save of the editor and the link answers with a 404 once it expired, so a stored copy would keep serving content which is outdated or gone. The expiration timestamp is deliberately not used as a cache ttl.

The headers are written by Flyo\Laravel\Middleware\PreventDraftCaching, which the package registers as the outermost global middleware, so it also covers routes which do not use the CachingHeaders middleware.

Rendering a hint

EntityController hands the draft state to the view, so a template can tell the visitor that this is not the live page:

Everywhere else the state is readable from Flyo\Laravel\DraftMode:

A custom controller resolving an entity itself flags the draft by calling Flyo\Laravel\Components\Head::metaEntity($entity) (which every entity page does anyway to assign its meta data) or explicitly:

Multilanguage

The requests will pass the configured APP_LOCALE (which is used in laravel for localization) to the flyo api.

Defined the available locales in the config/flyo.php file:

The ServiceProvider will check for segments /de, /en in the url and set the locale in the request object if the locale is available in the config file.

Pass the language for entity Detail Requests:

Misc

In order to resolve the Configuration object somewhere in your application, you can use the following code:

Same for the page response

Example AGENTS.md

If you build your project with an AI coding assistant (Claude Code, Copilot, Cursor, etc.), drop an AGENTS.md file in your project root so the assistant understands your stack and knows where to find the Flyo/Nitro documentation. AGENTS.md is the vendor-neutral convention most coding agents read on startup, and if your tool uses a specific memory file such as CLAUDE.md, use that name too (or have it reference AGENTS.md).

Here is a minimal starting point you can copy and adapt. Note that it self-references this library's docs, the usage guide and the AI integration advisory, so the assistant can pull in the full Flyo Nitro setup and context on demand:

Documentation

Read More in the Docs

Upgrading

See UPGRADE.md for what changed between versions.

Package Development

  1. Check the example-app/.env file to have a correct flyo token.
  2. Go to example-app and run php artisan serve to get the example app running.

Run the checks the CI runs:


All versions of nitro-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
flyo/nitro-php Version ^3.6
laravel/framework Version ^11|^12|^13
flyo/nitro-php-bridge Version ^1.2
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 flyo/nitro-laravel contains the following files

Loading the files please wait ...