How to seed a model that has a relationship to itself

I am using Laravel 8 and PHP v7.4 I have a model with a schema generated with the below migration. CreateContestsTable public function up() { Schema::create(‘contests’, function (Blueprint $table) …

laravel seeder is giving an error and won’t seed

I’ve been trying to get my seeder to work but it keeps giving me the following error Call to undefined function DatabaseSeedersfactory() at database/seeders/ContactTableSeeder.php:16 12▕ …

Laravel eloquent multiple belongsTo seeding

I have three models, User, Category and Article. Article belongs to both a User and a Category where the foreign keys user_id and category_id are not null. Am lost trying to seed the database …

How to implement your own Faker provider in Laravel

I want to create a custom provider for Faker in Laravel (e.g. one for a random building name). Where do I store the custom provider in my application and how do I use it?