New

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

pxlrbt/laravel-database-state

Seed critical state for your production DBs.
1,500 4

Larablocks Analysis

pxlrbt/laravel-database-state works with Laravel 11, 12 and 13 (latest release v2.0.0, Mar 23, 2026).

Laravel 9 and 10 in earlier releases.

Promising: maintained and up to date, meets 2 of 4 checks; not yet widely used.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Mar 23, 2026)
  • 235 downloads a month (needs 10,000)
  • 4 GitHub stars (needs 100)

State

Maintained
  • Last stable release: Mar 23, 2026.
  • 2 releases in the last 12 months.
  • First released: Aug 8, 2023.
  • Monthly downloads: 235.
  • 0 open issues on GitHub.

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

Install
composer require pxlrbt/laravel-database-state
Latest Version:v2.0.0
PHP:^8.2
Laravel:11 · 12 · 13
Older releases:9 · 10
License:MIT
Last Updated:Oct 7, 2026
Links: GitHub  ·  Packagist
Maintainer: pxlrbt

Laravel Database State

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Seed critical state your databases with production data.

Installation

You can install the package via composer:

composer require pxlrbt/laravel-database-state

Add autoloader

Add the Database\States namespace to the composer.json

{
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/",
            "Database\\States\\": "database/states/"
        }
    }
}

Create your first database state

You can create a new class via CLI: php artisan make:db-state. This will create an invokable class in database/States directory.

Make sure your database states are idempotent, so consecutive runs won't create duplicate entries or overwrite existing entries.

<?php
namespace Database\States;

use App\Models\User;

class UserState
{
    public function __invoke()
    {
        if (! User::where('user', 'info@example.com')->exists()) {
            User::forceCreate([
                'name' => 'Example User',
                'email' => 'info@example.com',
                'email_verified_at' => now(),
                'password' => '$2y$10$etbrxzCyYhs598Abu6XdAeJ7GZQvDhOvE70XnRtoO25bvif1uEvSi',
            ]);
        }
    }
}

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

omaximus/laravel-advanced-seeder

Advanced seeding for laravel framework

42,634 1
codingphase/seeder

Easy seeding database for Laravel Applications.

5,019 1
illuminatech/enum-seeder

Allows easy creation of DB seeders for the dictionary (enum) type tables

1,992 3
socialengine/setup-test-db

Get efficient with seeding your database for tests in Laravel

14,055 9
aedart/athenaeum-database

Database utilities for Laravel

25,027 0

Version History

Version Released PHP Laravel License
v2.0.0 ^8.2 ^11.0|^12.0|^13.0 MIT
v1.0.7 ^8.1 ^9.0|^10.0|^11.0|^12.0|^13.0 MIT
v1.0.6 ^8.1 ^9.0|^10.0|^11.0|^12.0 MIT
v1.0.5 ^8.1 ^9.0|^10.0|^11.0 MIT
v1.0.4 ^8.1 ^9.0|^10.0|^11.0 MIT