PHPackages                             dbfx/laravel-strapi - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dbfx/laravel-strapi

ActiveLibrary

dbfx/laravel-strapi
===================

Laravel wrapper for using the Strapi headless CMS

v4.0.1(2y ago)5032.3k↓27.4%34[1 issues](https://github.com/dbfx/laravel-strapi/issues)[3 PRs](https://github.com/dbfx/laravel-strapi/pulls)MITPHPPHP ^7.4 || ^8.0CI failing

Since Apr 27Pushed 1y ago3 watchersCompare

[ Source](https://github.com/dbfx/laravel-strapi)[ Packagist](https://packagist.org/packages/dbfx/laravel-strapi)[ Docs](https://github.com/dbfx/laravel-strapi)[ GitHub Sponsors](https://github.com/dbfx)[ RSS](/packages/dbfx-laravel-strapi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (14)Versions (25)Used By (0)

Laravel wrapper for using the Strapi headless CMS
=================================================

[](#laravel-wrapper-for-using-the-strapi-headless-cms)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b0ead4c1fb8c4aba038a7a4df73d425fe8a4c67197c9e085f0bddc68a94a6cda/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646266782f6c61726176656c2d7374726170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dbfx/laravel-strapi)[![Total Downloads](https://camo.githubusercontent.com/acb2c07a4d8b998bf8d46746aa56147617566c1b448ffd436dc079a58adf2b87/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646266782f6c61726176656c2d7374726170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dbfx/laravel-strapi)

---

Laravel-Strapi is a Laravel helper for using the Strapi headless CMS.

Note: for Strapi v3 support use version 2.x.x

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require dbfx/laravel-strapi
```

You can publish and run the migrations with:

You can publish the config file with:

```
php artisan vendor:publish --provider="Dbfx\LaravelStrapi\LaravelStrapiServiceProvider" --tag="strapi-config"
```

You need to define your STRAPI\_URL and STRAPI\_CACHE\_TIME in .env: You can also optionally define a STRAPI\_TOKEN to enable authentication. Do not include 'Bearer' only the token itself.

```
STRAPI_URL=https://strapi.test.com
STRAPI_CACHE_TIME=3600
STRAPI_TOKEN=abcd1234abcd1234

```

Usage
-----

[](#usage)

laravel-strapi provides the collection() and entry() calls to return a full collection, or a specific entry from a collection. In the example below we are querying the strapi collection 'blogs' and then getting the entry with id 1 from that collection.

```
use Dbfx\LaravelStrapi\LaravelStrapi;

$strapi = new LaravelStrapi();
$blogs = $strapi->collection('blogs');
$entry = $strapi->entry('blogs', 1);
```

There are several useful options available as well.

- `$sortKey` and `$sortOrder` allow you to specify the key to sort on and the direction
- `$fullUrls` will automatically add your STRAPI\_URL to the front of any relative URLs (e.g. images, etc).
- `$limit` sets how many items you are requesting
- `$start` is the offset to be used with limit, useful for pagination
- `$populate` is an array containing the fields to populate
- `$queryData` is an array of additional key-value pairs to add to the query string

```
use Dbfx\LaravelStrapi\LaravelStrapi;

$strapi = new LaravelStrapi();
$blogs = $strapi->collection('blogs', $sortKey = 'id', $sortOrder = 'DESC', $limit = 20, $start = 0, $fullUrls = true, $populate = ['author', 'images'], $queryData = ['locale' => 'en']);

$entry = $strapi->entry('blogs', 1, $fullUrls = true, $populate = ['author', 'images'], $queryData = ['locale' => 'en']);
```

You may also access Single Type items as follows:

```
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');
```

And you may select entries by searching for a custom field (e.g. slug):

```
use Dbfx\LaravelStrapi\LaravelStrapi;

$strapi = new LaravelStrapi();

$entries = $strapi->entriesByField('blogs', 'slug', 'test-blog-post');
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Dave Blakey](https://github.com/dbfx)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 63.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~50 days

Recently: every ~174 days

Total

21

Last Release

834d ago

Major Versions

v1.2.0 → v2.0.02022-03-09

v2.0.2 → v3.0.02022-11-07

v3.0.0 → v4.0.02024-02-04

PHP version history (4 changes)v1.0.0PHP ^7.3|^7.4|^8.0

v1.1.0PHP ^7.3|^7.4|^8.0|^8.1

v4.0.0PHP ^7.3|^7.4|^8.0|^8.1|^8.2

v4.0.1PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/46f41c205c46cf236cdc79a7c644d7eaaa69b505a44cb6047103b4ad2bd08a2f?d=identicon)[dbfx](/maintainers/dbfx)

---

Top Contributors

[![dbfx](https://avatars.githubusercontent.com/u/182394?v=4)](https://github.com/dbfx "dbfx (64 commits)")[![Stubbs](https://avatars.githubusercontent.com/u/43525?v=4)](https://github.com/Stubbs "Stubbs (11 commits)")[![jorisdrenth](https://avatars.githubusercontent.com/u/10384146?v=4)](https://github.com/jorisdrenth "jorisdrenth (8 commits)")[![sietzekeuning](https://avatars.githubusercontent.com/u/11088108?v=4)](https://github.com/sietzekeuning "sietzekeuning (8 commits)")[![frugan-dev](https://avatars.githubusercontent.com/u/7957714?v=4)](https://github.com/frugan-dev "frugan-dev (4 commits)")[![aps74](https://avatars.githubusercontent.com/u/81538937?v=4)](https://github.com/aps74 "aps74 (1 commits)")[![VincentBean](https://avatars.githubusercontent.com/u/3906942?v=4)](https://github.com/VincentBean "VincentBean (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![graciano](https://avatars.githubusercontent.com/u/3246681?v=4)](https://github.com/graciano "graciano (1 commits)")[![kfina91](https://avatars.githubusercontent.com/u/72922128?v=4)](https://github.com/kfina91 "kfina91 (1 commits)")

---

Tags

hacktoberfestlaravellaravel-packagestrapistrapi-cmslaravellaravel-packagestrapilaravel-strapistrapi-cms

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dbfx-laravel-strapi/health.svg)

```
[![Health](https://phpackages.com/badges/dbfx-laravel-strapi/health.svg)](https://phpackages.com/packages/dbfx-laravel-strapi)
```

###  Alternatives

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[larament/seokit

A complete SEO package for Laravel, covering everything from meta tags to social sharing and structured data.

411.9k](/packages/larament-seokit)[basillangevin/laravel-data-json-schemas

Transforms Spatie Data objects into JSON Schemas with built-in validation

1312.2k1](/packages/basillangevin-laravel-data-json-schemas)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
