PHPackages                             dotkernel/dot-data-fixtures - 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. dotkernel/dot-data-fixtures

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

dotkernel/dot-data-fixtures
===========================

Provides a CLI interface for listing &amp; executing doctrine data fixtures

1.5.0(6mo ago)733.4k↑77.9%33MITPHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Aug 23Pushed 6mo ago3 watchersCompare

[ Source](https://github.com/dotkernel/dot-data-fixtures)[ Packagist](https://packagist.org/packages/dotkernel/dot-data-fixtures)[ Docs](https://github.com/dotkernel/dot-data-fixtures)[ RSS](/packages/dotkernel-dot-data-fixtures/feed)WikiDiscussions 1.0 Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (17)Used By (3)

dot-data-fixtures
=================

[](#dot-data-fixtures)

`dot-data-fixtures` provides a CLI interface for interacting with doctrine/data-fixtures.

> dot-data-fixtures is a wrapper on top of [doctrine/data-fixtures](https://github.com/doctrine/data-fixtures)

Documentation
-------------

[](#documentation)

Documentation is available at: .

Badges
------

[](#badges)

[![OSS Lifecycle](https://camo.githubusercontent.com/57f01f0d7009d82d98255392c0011852a1ae9909950e46189e4251049fb9b2c5/68747470733a2f2f696d672e736869656c64732e696f2f6f73736c6966656379636c652f646f746b65726e656c2f646f742d646174612d6669787475726573)](https://camo.githubusercontent.com/57f01f0d7009d82d98255392c0011852a1ae9909950e46189e4251049fb9b2c5/68747470733a2f2f696d672e736869656c64732e696f2f6f73736c6966656379636c652f646f746b65726e656c2f646f742d646174612d6669787475726573)[![PHP from Packagist (specify version)](https://camo.githubusercontent.com/ce258d5b2a1e85009cbbbb24488456e6ed7d4915dad092fa38427b36a819b9fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f646f746b65726e656c2f646f742d646174612d66697874757265732f312e352e30)](https://camo.githubusercontent.com/ce258d5b2a1e85009cbbbb24488456e6ed7d4915dad092fa38427b36a819b9fe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f646f746b65726e656c2f646f742d646174612d66697874757265732f312e352e30)

[![GitHub issues](https://camo.githubusercontent.com/0396797c8ddaca1ad5208b0acdab0da76d8793a2669e8b9e01c0b7f9e161aabb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f646f746b65726e656c2f646f742d646174612d6669787475726573)](https://github.com/dotkernel/dot-data-fixtures/issues)[![GitHub forks](https://camo.githubusercontent.com/20f6c65eb4331174a8b6fc6111761a82af7bfbe440feae89db4bbbe8f3a6b09b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f646f746b65726e656c2f646f742d646174612d6669787475726573)](https://github.com/dotkernel/dot-data-fixtures/network)[![GitHub stars](https://camo.githubusercontent.com/d94da494a12074075f3d6983024ac0f4a2704090bfa8f20da108d1c8795f2577/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f646f746b65726e656c2f646f742d646174612d6669787475726573)](https://github.com/dotkernel/dot-data-fixtures/stargazers)[![GitHub license](https://camo.githubusercontent.com/1723c0c25aaf9f0884751742088d98ed199a03f510a72f7015cd74f948c9d730/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f646f746b65726e656c2f646f742d646174612d6669787475726573)](https://github.com/dotkernel/dot-data-fixtures/blob/1.0/LICENSE)

[![Build Static](https://github.com/dotkernel/dot-data-fixtures/actions/workflows/continuous-integration.yml/badge.svg?branch=1.0)](https://github.com/dotkernel/dot-data-fixtures/actions/workflows/continuous-integration.yml)[![codecov](https://camo.githubusercontent.com/7c7a48353159d92fe67d2be69d0baf7761e73c8083caa89bd3612e410ce193d5/68747470733a2f2f636f6465636f762e696f2f67682f646f746b65726e656c2f646f742d646174612d66697874757265732f67726170682f62616467652e7376673f746f6b656e3d50474f585a4f5a414230)](https://codecov.io/gh/dotkernel/dot-data-fixtures)[![PHPStan](https://github.com/dotkernel/dot-data-fixtures/actions/workflows/static-analysis.yml/badge.svg?branch=1.0)](https://github.com/dotkernel/dot-data-fixtures/actions/workflows/static-analysis.yml)

This package provides a CLI interface for interacting with doctrine/data-fixtures.

**Executing fixtures will append data to the tables.**

Requirements
------------

[](#requirements)

- **PHP**: 8.2, 8.3 or 8.4
- **doctrine/orm**: =&gt; 3.0
- **doctrine/data-fixtures**: =&gt; 2.0

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

[](#installation)

Run the following command in your project directory

```
composer require dotkernel/dot-data-fixtures
```

Next, register the package's ConfigProvider into your application config.

```
\Dot\DataFixtures\ConfigProvider::class,
```

In `doctrine.global.php` (or your custom doctrine config file) add a new key `fixtures`, in the `doctrine` array, the value should be a valid path to a folder where your fixtures can be found.

**Make sure the path is valid before proceeding to the next step.**

### Example

[](#example)

```
return [
    'dependencies' => [ ... ],
    'doctrine' => [
        ...,
        'fixtures' => getcwd() . '/data/doctrine/fixtures',
    ],
];
```

The last step is to register the commands. We can register the commands to work with the default CLI that doctrine provides us. Create a new php file `bin/doctrine` (if you don't already have this file feel free to copy it from the below example)

```
