PHPackages                             dev-dima-kr/laravel-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. [Testing &amp; Quality](/categories/testing)
4. /
5. dev-dima-kr/laravel-fixtures

ActiveLibrary[Testing &amp; Quality](/categories/testing)

dev-dima-kr/laravel-fixtures
============================

Laravel Fixtures are used to load a 'fake' set of data into a database that can then be used for testing

01.4kPHPCI failing

Since Feb 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/dev-dima-kr/laravel-fixtures)[ Packagist](https://packagist.org/packages/dev-dima-kr/laravel-fixtures)[ RSS](/packages/dev-dima-kr-laravel-fixtures/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

 [![](https://avatars0.githubusercontent.com/u/36246510?s=200&v=4)](https://avatars0.githubusercontent.com/u/36246510?s=200&v=4)

Laravel Fixtures Package
========================

[](#laravel-fixtures-package)

Fixtures are used to load a "fake" set of data into a database that can then be used for testing or to help give you some interesting data while you're developing your application.

A fixture may depend on other fixtures, specified via its `LaravelFlux\Fixture\Fixture::$depends` property. When a fixture is being loaded, the fixtures it depends on will be automatically loaded BEFORE the fixture; and when the fixture is being unloaded, the dependent fixtures will be unloaded AFTER the fixture.

[![Latest Stable Version](https://camo.githubusercontent.com/22aa6645a0fe1596af786620abe517de436cf8664f41e1cbbcbb059672aadf95/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c666c75782f6c61726176656c2d66697874757265732f762f737461626c65)](https://packagist.org/packages/laravelflux/laravel-fixtures)[![Total Downloads](https://camo.githubusercontent.com/4dd57e5932a7f3df183edf7263caa8c401b18356562ae36a30064ffd23ce1236/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c666c75782f6c61726176656c2d66697874757265732f646f776e6c6f616473)](https://packagist.org/packages/laravelflux/laravel-fixtures)[![License](https://camo.githubusercontent.com/762da6a1c4bf0b7cc1e535a2d9c5dc95f7302cff66bf236cec5b23528438a40e/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c666c75782f6c61726176656c2d66697874757265732f6c6963656e7365)](https://packagist.org/packages/laravelflux/laravel-fixtures)[![Build Status](https://camo.githubusercontent.com/dbe89f44a753ecb21ff9ec14418f6d0b36a3edc890ea23805243a81b9392d122/68747470733a2f2f7472617669732d63692e6f72672f6c61726176656c666c75782f6c61726176656c2d66697874757265732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/laravelflux/laravel-fixtures)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/952f1c7c53a8adc96860a77e0c420c304a6f42cf4e366cb80cd031b44fd39af9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c61726176656c666c75782f6c61726176656c2d66697874757265732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/laravelflux/laravel-fixtures/?branch=master)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist laravelflux/laravel-fixtures "*"

```

or add

```
"laravelflux/laravel-fixtures": "*"

```

to the require section of your `composer.json` file.

### Defining a Fixture

[](#defining-a-fixture)

> Tip: If your model uses the Laravel Scout package then use the `LaravelFlux\Fixture\EloquentFixture` class instead of `LaravelFlux\Fixture\ActiveFixture`.

To define a fixture, create a new class by extending `LaravelFlux\Fixture\ActiveFixture`.

The following code defines a fixture about the `User` Illuminate\\Database\\Eloquent\\Model and the corresponding users table.

```
