Top "Laravel-seeding" questions

Laravel includes a simple method of seeding your database with test data using seed classes.

Laravel 5.2: Unable to locate factory with name [default]

I want to seed database when I use this public function run() { $users = factory(app\User::class, 3)->create(); } …

php laravel laravel-5 laravel-5.2 laravel-seeding
Laravel : How do I insert the first user in the database

I am using Laravel (4.2) I am working on a project with an authentication system. I need to insert a first …

mysql laravel laravel-4 laravel-seeding
Laravel timestamps() doesn't create CURRENT_TIMESTAMP

I have a migration that has the timestamps() method, and then I have a seed to seed this table. Schema::…

php laravel eloquent laravel-migrations laravel-seeding
Laravel 5.3 db:seed command simply doesn't work

I do everything by-the-book: Installed fresh Laravel 5.3.9 app (all my non-fresh apps produce the same error) run php artisan make:…

php laravel seeding laravel-5.3 laravel-seeding
How to pass arguments to Laravel factories?

I have a users table and a one-to-zero/one relation with a businesses table (users.user_id => businesses.user_…

laravel factory laravel-seeding
Laravel 5.1 Migration and Seeding Cannot truncate a table referenced in a foreign key constraint

I'm trying to run the migration (see below) and seed the database, but when I run php artisan migrate --seed …

mysql laravel laravel-5 laravel-migrations laravel-seeding
How to seed database migrations for laravel tests?

Laravel's documentation recommends using the DatabaseMigrations trait for migrating and rolling back the database between tests. use Illuminate\Foundation\Testing\…

php laravel testing laravel-migrations laravel-seeding
Laravel - Seeding Many-to-Many Relationship

I have a users table and a roles table that has a many-to-many relationship. These two tables are connected to …

laravel laravel-5 factory faker laravel-seeding
A four digit year could not be found Data missing

I'm trying to seed using factories in Laravel 5.2 My code dies in the User factory: $factory->define(App\User::…

php laravel laravel-seeding
laravel seed rollback after seeded to database

I have seeded my db using php artisan db::seed. Is there a way to rollback what I have seeded …

laravel rollback laravel-seeding