Download the PHP package rapidez/strapi without Composer
On this page you can find all versions of the php package rapidez/strapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rapidez/strapi
More information about rapidez/strapi
Files in rapidez/strapi
Package strapi
Short Description Rapidez Strapi
License GPL-3.0-or-later
Homepage https://rapidez.io
Informations about the package strapi
Rapidez Strapi
Requirements
A Strapi instance running, configured and filled with content types.
Installation
Add the Strapi url to your .env
:
Routes
Register some routes within routes/web.php
and use the strapi()
helper function to get the data. This function accepts the endpoint as parameter and just calls that endpoint and caches the response. For example:
And use the data in your views. For example with {{ $data->name }}
you'll get the content of the name field.
Dynamic zones
When you're using a dynamic zone within your content type you can render them with a Blade directive:
This tries to render views with the same name as the component and the data will be available with the $data
variable.
There is also a possibility to pass extra data to the template. For this you can pass an array as the second parameter:
The above example makes the variables $foo
and $article
available in the template
Cache
By default all responses from Strapi will be cached for 1 hour. You can change that with STRAPI_CACHE
in your .env
Automatic cache clearing
You can setup a webhook within Strapi which will be called when something changes. If you configure that with the cache clear url from Rapidez you don't have to worry about content not showing up after changes. See the Rapidez cache docs.
License
GNU General Public License v3. Please see License File for more information.