Laravel 5.3 Seeding Users Dynamically

Seeding Users Dynamically in Laravel 5.3 – create $user object through models, factories, faker and seeding.
What this does:
  1. Allows you to create admin users with specific accounts – emails/passwords etc
  2. Uses the User Service to bind the users to a role, in this case the Admin role

Then after this script I have one which does the following:

  1. Uses Faker to generate a whole heap of regular users assigned to member role

And to create the normal (random) users through Faker.


Sam Deering

Sam Deering is a web developer from England (currently living in Australia). In his spare time he enjoys coding, playing chess, reading and investing.

Leave a Reply

Your email address will not be published. Required fields are marked *