1. Go to this page and download the library: Download dbfx/laravel-strapi library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dbfx / laravel-strapi example snippets
use Dbfx\LaravelStrapi\LaravelStrapi;
$strapi = new LaravelStrapi();
$blogs = $strapi->collection('blogs');
$entry = $strapi->entry('blogs', 1);
use Dbfx\LaravelStrapi\LaravelStrapi;
$strapi = new LaravelStrapi();
// Fetch the full homepage array
$homepageArray = $strapi->single('homepage');
// Return just the ['content'] field from the homepage array
$homepageItem = $strapi->single('homepage', 'content');
use Dbfx\LaravelStrapi\LaravelStrapi;
$strapi = new LaravelStrapi();
$entries = $strapi->entriesByField('blogs', 'slug', 'test-blog-post');