0 && Recipe::count() > 0) { Recipe::each(function ($recipe) { User::inRandomOrder() ->first() ->author_of_recipe() ->attach($recipe->id); }); } } }