Skip to content

Instantly share code, notes, and snippets.

@densityx
Created December 24, 2018 08:59
Show Gist options
  • Save densityx/03868b97414dfc5bb9d06d08c1026682 to your computer and use it in GitHub Desktop.
Save densityx/03868b97414dfc5bb9d06d08c1026682 to your computer and use it in GitHub Desktop.
Dispatch job in laravel seeder after model creation
factory(User::class, 10)->create()->each(function ($user) {
GenerateUserPoster::dispatch($user);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment