Skip to content
Advertisement

Tag: laravel-factory

Laravel 9 – Seeder | TypeError array_merge(): Argument #2 must be of type array, int given

I have two tables named Order and OrderItem. While creating data in the Order table, I am trying to enter data into the OrderItem table at the same time. The codes are as follows; OrderSeeder.php OrderFactory.php OrderItemFactory.php Answer When I updated the page like this, the problem was solved. OrderSeeder.php You can use it as a resource when you encounter

Laravel Many-to-Many Factory with custom id type

I am using Laravel 8 and trying to make database factories/seeders I am having some issues. I have the following database Schema: Now I am trying to create factories and database seeders but I get an error using the following line to seed: This gives me the following error: Which is if I understand it correctly because an isbn number

Advertisement