PHPackages                             campaigningbureau/cf-repository-generator - 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. [Database &amp; ORM](/categories/database)
4. /
5. campaigningbureau/cf-repository-generator

ActiveLibrary[Database &amp; ORM](/categories/database)

campaigningbureau/cf-repository-generator
=========================================

Generates required repositories, factories and models to access a new Contentful Content Type in Laravel

v10.1.0(1y ago)09.6k↓100%2[1 issues](https://github.com/CampaigningBureau/cf-repository-generator/issues)MITPHPPHP ^8.1CI failing

Since Feb 12Pushed 1y ago3 watchersCompare

[ Source](https://github.com/CampaigningBureau/cf-repository-generator)[ Packagist](https://packagist.org/packages/campaigningbureau/cf-repository-generator)[ RSS](/packages/campaigningbureau-cf-repository-generator/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (6)Versions (28)Used By (0)

Contentful Repository Generator for Laravel 7 (8 and 9)
=======================================================

[](#contentful-repository-generator-for-laravel-7-8-and-9)

Laravel 7 Contentful Repository generator.

Generates contract, contentful repository, model, factory and caching repository with fields that are defined in the Contentful model. ()

If one of these files does already exist, it can be kept or overwritten.

Usage
-----

[](#usage)

### Step 1: Install Through Composer

[](#step-1-install-through-composer)

```
composer require campaigningbureau/cf-repository-generator

```

#### Supported versions

[](#supported-versions)

Package versionRequired Laravel versionMinimum PHP version^10.110.x or 11.x^8.1^8.29.x^8.0.2v8.\*87.3.0v7.\*77.2.5v6.\*67.1.3v4.\*5.87.1.3v3.\*&gt;= 5.6 &lt; 5.87.1.3v2.\*&lt; 5.67.0### Step 2: Register the Service Provider

[](#step-2-register-the-service-provider)

Add the service provider to `config/app.php`.

```
	/*
	 * Package Service Providers...
	 */
	CampaigningBureau\CfRepositoryGenerator\CfRepositoryGeneratorServiceProvider::class,
```

### Step 3: Publish and edit the config file

[](#step-3-publish-and-edit-the-config-file)

```
$ php artisan vendor:publish --provider="CampaigningBureau\CfRepositoryGenerator\CfRepositoryGeneratorServiceProvider"
```

### Step 4: Create repositories

[](#step-4-create-repositories)

`php artisan make:cf-repository`

This command will load all content types that are defined in the configured contentful space and provide an easy way to generate the relevant classes.

The generated files also contain fake repositories, that can be used instead of the actual contentful data (for instance, if no data is available during development). The whole directory (`FakeData` by default) can be removed, if it isn't used.

Configuration
-------------

[](#configuration)

The published config file `config/cf-repository-generator.php` contains the paths for the generated files inside the `app` directory. To be conform to PSR-4 autoloading, the namespaces of the files are generated out of these paths.

These are the default paths, that will be used, if the config file isn't published, or if the config keys don't exist:

```
return [
    'paths' => [
        'contracts'            => 'Repositories/Contracts/',
        'repositories'         => 'Repositories/',
        'caching-repositories' => 'Repositories/Caching/',
        'models'               => 'Models/',
        'factories'            => 'Factories/',
        'fake-data'            => 'FakeData/',
    ],
];
```

- The `contentful_delivery_space` and `contentful_delivery_token` fields need to be set with the API Key and Space ID retrieved from Contentful.
- By default they are set with the .env variables `CONTENTFUL_DELIVERY_SPACE` and `CONTENTFUL_DELIVERY_TOKEN`.
- `CONTENTFUL_ENVIRONMENT_ID` defines the Contentful environment to use (defaults to `master`)

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 69% 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 ~101 days

Recently: every ~231 days

Total

25

Last Release

567d ago

Major Versions

v3.0 → v4.0.02019-04-16

v4.1.0 → v7.0.02020-08-03

v7.2.0 → v8.0.02021-02-10

v6.0.0 → v8.1.02021-11-25

v8.2.2 → v10.02023-12-04

PHP version history (7 changes)v1.0.0PHP &gt;=7.0

v3.0PHP ^7.1.3

v7.0.0PHP ^7.2

v8.0.0PHP ^7.3

v8.1.0PHP ^7.3|^8.0

v8.2.0PHP ^7.3||^8.0

v10.1.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3008376?v=4)[Campaigning Bureau](/maintainers/campaigningbureau)[@CampaigningBureau](https://github.com/CampaigningBureau)

---

Top Contributors

[![stefanschindler](https://avatars.githubusercontent.com/u/786048?v=4)](https://github.com/stefanschindler "stefanschindler (29 commits)")[![DmitrySidorenkoShim](https://avatars.githubusercontent.com/u/8822805?v=4)](https://github.com/DmitrySidorenkoShim "DmitrySidorenkoShim (8 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")

---

Tags

laravelrepositorycontentful

### Embed Badge

![Health badge](/badges/campaigningbureau-cf-repository-generator/health.svg)

```
[![Health](https://phpackages.com/badges/campaigningbureau-cf-repository-generator/health.svg)](https://phpackages.com/packages/campaigningbureau-cf-repository-generator)
```

###  Alternatives

[illuminatech/config

Provides support for Laravel application runtime configuration managed in persistent storage

14921.0k1](/packages/illuminatech-config)[ozankurt/repoist

Laravel ^5.6 repository generator.

9244.1k](/packages/ozankurt-repoist)[crcms/repository

Detached model and controller warehouse data provider

674.4k3](/packages/crcms-repository)

PHPackages © 2026

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