PHPackages                             ducnv157/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. [API Development](/categories/api)
4. /
5. ducnv157/laravel-strapi

ActiveLibrary[API Development](/categories/api)

ducnv157/laravel-strapi
=======================

Laravel wrapper for using the Strapi headless CMS

v1.0.0(1y ago)09MITPHPPHP ^8.0

Since Dec 29Pushed 1y agoCompare

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

READMEChangelog (1)Dependencies (14)Versions (2)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

26

—

LowBetter than 43% of packages

Maintenance41

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63% 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

Unknown

Total

1

Last Release

498d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c858628a5e50b45ece016cffeacbb962984ecb39800f7aa42827f1b078b5df40?d=identicon)[ducnv157](/maintainers/ducnv157)

---

Top Contributors

[![dbfx](https://avatars.githubusercontent.com/u/182394?v=4)](https://github.com/dbfx "dbfx (63 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)")[![ducnv157](https://avatars.githubusercontent.com/u/150279337?v=4)](https://github.com/ducnv157 "ducnv157 (1 commits)")[![kfina91](https://avatars.githubusercontent.com/u/72922128?v=4)](https://github.com/kfina91 "kfina91 (1 commits)")

---

Tags

laravellaravel-packagestrapilaravel-strapistrapi-cms

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[dbfx/laravel-strapi

Laravel wrapper for using the Strapi headless CMS

5032.3k](/packages/dbfx-laravel-strapi)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)

PHPackages © 2026

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