New

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

coderello/laravel-populated-factory

An easy way to generate populated factories.
23,137 245

Larablocks Analysis

coderello/laravel-populated-factory works with Laravel 8 (latest release 1.1.0, Nov 18, 2020), which reached end of life on Jan 24, 2023: no more fixes, even for security.

Laravel 5, 6 and 7 in earlier releases.

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 8, past end of life since Jan 24, 2023
  • No release in the last 12 months (last: Nov 18, 2020)
  • 75 downloads a month (needs 10,000)
  • 245 GitHub stars (at least 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Nov 18, 2020.
  • No releases in the last 12 months.
  • First released: Mar 7, 2019.
  • Monthly downloads: 75, up 733% from six months ago.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require coderello/laravel-populated-factory
Latest Version:1.1.0
PHP:^7.3|^8.0
Laravel:8
Older releases:5 · 6 · 7
License:MIT
Last Updated:Nov 18, 2020
Links: GitHub  ·  Packagist
Maintainer: coderello

Laravel Populated Factory

Laravel Populated Factory provides an easy way to generate populated factories for models according to types & names of their columns.

Install

You can install this package via composer using this command:

composer require --dev coderello/laravel-populated-factory

The package will automatically register itself.

Usage

The only thing you need to do in order to generate a populated factory is to execute this command:

php artisan make:populated-factory User

This command assumes that the User model is in the App namespace. If your models are situated in another namespace (e.g. App\Models) you should specify them either as Models\\User or \\App\\Models\\User.

Here is the populated factory generated for the User model according to its column types & names.

<?php

use Faker\Generator as Faker;

/** @var $factory \Illuminate\Database\Eloquent\Factory */

$factory->define(\App\User::class, function (Faker $faker) {
    return [
        'name' => $faker->name,
        'email' => $faker->unique()->safeEmail,
        'email_verified_at' => $faker->dateTime,
        'password' => '$2y$10$uTDnsRa0h7wLppc8/vB9C.YqsrAZwhjCgLWjcmpbndTmyo1k5tbRC',
        'remember_token' => $faker->sha1,
        'created_at' => $faker->dateTime,
        'updated_at' => $faker->dateTime,
    ];
});

If you want a custom name for the factory, you need to pass it as the second argument like so:

php artisan make:populated-factory User AdminFactory

If you want to override the existent factory, you need to use --force flag like so:

php artisan make:populated-factory User --force

Contributing

Please see CONTRIBUTING for details.

License

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

Related Packages

thedoctor0/laravel-factory-generator

Automatically generate Laravel factories for your models.

1,289,290 214
league/factory-muffin

The goal of this package is to enable the rapid creation of objects for the purp...

16,327,163 529
jeffochoa/factory-stories

Create model factory stories in Laravel 5.*

67,446 78
aerni/factory

Quickly whip up fake content

3,527 19
mpociot/laravel-test-factory-helper

Generate Laravel test factories from your existing models

647,118 928

Version History

Version Released PHP Laravel License
1.1.0 ^7.3|^8.0 ^8.0 MIT
1.0.0 ^7.3 ^8.0 MIT
0.3.2 ^7.2 5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0 MIT
0.3.1 ^7.2 5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0 MIT
0.3.0 ^7.2 5.5.*|5.6.*|5.7.*|5.8.*|6.* MIT