New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

asvae/laravel-fixtures

20 7

Larablocks Analysis

asvae/laravel-fixtures works with Laravel 5 (latest release 0.1.2, Jan 25, 2017), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 5, past end of life
  • No release in the last 12 months (last: Jan 25, 2017)
  • 0 downloads a month (needs 10,000)
  • 7 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jan 25, 2017.
  • No releases in the last 12 months.
  • First released: Jan 25, 2017.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.

Install
composer require asvae/laravel-fixtures
Latest Version:0.1.2
PHP:>=5.4.0
Laravel:5
License:MIT
Last Updated:Jan 25, 2017
Links: GitHub  ·  Packagist
Maintainer: asvae

Intention

When working with database, sometimes we need to modify schema, and sometimes data. Doing both things in laravel migrations is painful. This package gives simple means to keep two of them separately.

Installation

Install via composer:

composer require asvae/laravel-fixtures

To your App\Console\Kernel add command like this:

protected $commands = [
    // ...
    
    \Asvae\LaravelFixtures\Commands\FixtureRun::class,
];

Usage

For your fixtures be sure to extend\Asvae\LaravelFixtures\AbstractFixture class or at least implement Asvae\LaravelFixtures\FixtureContract. Abstract class has several utility methods to keep you going:

$this->runFixture($className); // Runs another fixture.
$this->runArray($className); // Run [nested] array of fixtures

To run fixture do php artisan fixture:run "\App\Fixtures\YourFixture". This will basically run run method in given class, while also resolving dependencies in case you defined any in constructor.

Config

No config file provided as the library is way too small. You can define default namespace in .env file though. This will be used when you pass class name without namespace

FIXTURES_NAMESPACE=App\MyFixtures

Examples

Take a look at several examples. For the case depicted, in production, to fully migrate data you will run

php artisan fixture:run "\Asvae\LaravelFixtures\Examples\FixtureSet"

In development, to refresh single table you will run solitary fixtures as these are much faster.

Hints

  • You can copy namespaced class name in PHPStorm by placing cursor onto class name and pressing Ctrl (⌘) + Shift + Alt + C
  • If you want to add some functionality, feel free to just copy package in your project. Several classes won't hurt.
  • Spread a word or leave a star if what I did was helpful for you.

Related Packages

nunomaduro/laravel-optimize-database

Publishes migrations that make your database production ready.

69,172 266
proai/laravel-super-migrations

This Laravel package is useful for big databases for a better migrations structu...

2,834 11
maxim-oleinik/blade-migrations

Raw SQL database migration tool for PHP apps

2,357 0
leafs/schema

Git for your database

3,845 0
laravel-doctrine/migrations

Doctrine Migrations for Laravel

3,100,416 78

Version History

Version Released PHP Laravel License
0.1.2 >=5.4.0 5.* MIT
0.1.1 >=5.4.0 5.* MIT
0.1.0 >=5.4.0 5.* MIT
0.0.2 >=5.4.0 5.* MIT