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; } } } }