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.
Informations about the package nitro-laravel
Flyo Nitro Laravel Framework Module
publish the config
Adjust the token in config/flyo.php
Ensure to remove the default routes in
routes/web.phpwhich 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_namespacekey.
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.
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.
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:
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
Documentation
Package Development
- Check the
example-app/.envfile to have a correct flyo token. - Go to example-app and run
php artisan serveto get the example app running.
All versions of nitro-laravel with dependencies
flyo/nitro-php Version ^2.0
laravel/framework Version ^11|^12
flyo/nitro-php-bridge Version ^1.2