What happened with faker.js

It seems Marak, the primary maintainer for Faker, has deliberately pulled Faker’s source code and history from their GitHub repository and published a non-functional package in its place. For context, Marak has become known in recent history for some rather controversial comments regarding the late Aaron Swartz (whom they reference in Faker’s updated README) & … Read more

Laravel – Seeding Many-to-Many Relationship

You can use attach() or sync() method on a many-to-many relationship. There are multiple ways you can approach this. Here one of them: // Populate roles factory(App\Role::class, 20)->create(); // Populate users factory(App\User::class, 50)->create(); // Get all the roles attaching up to 3 random roles to each user $roles = App\Role::all(); // Populate the pivot table … Read more