From 7d999f0995e4837edab1885a92dc9f4ed72cea9d Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 29 May 2018 21:01:28 -0600 Subject: [PATCH] Add follow seeder --- app/Console/Commands/SeedFollows.php | 60 ++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 app/Console/Commands/SeedFollows.php diff --git a/app/Console/Commands/SeedFollows.php b/app/Console/Commands/SeedFollows.php new file mode 100644 index 000000000..81f23fabb --- /dev/null +++ b/app/Console/Commands/SeedFollows.php @@ -0,0 +1,60 @@ +firstOrFail(); + $target = Profile::orderByRaw('rand()')->firstOrFail(); + + $follow = new Follower; + $follow->profile_id = $actor->id; + $follow->following_id = $target->id; + $follow->save(); + + FollowPipeline::dispatch($follow); + } catch (Exception $e) { + continue; + } + } + } +}