Преглед изворни кода

Also fix orderByRaw in SeedFollows

Neil Alexander пре 7 година
родитељ
комит
efbb1017e7
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      app/Console/Commands/SeedFollows.php

+ 3 - 3
app/Console/Commands/SeedFollows.php

@@ -41,10 +41,10 @@ class SeedFollows extends Command
     {
         $limit = 10000;
 
-        for ($i=0; $i < $limit; $i++) { 
+        for ($i=0; $i < $limit; $i++) {
             try {
-                $actor = Profile::orderByRaw('rand()')->firstOrFail();
-                $target = Profile::orderByRaw('rand()')->firstOrFail();
+                $actor = Profile::inRandomOrder()->firstOrFail();
+                $target = Profile::inRandomOrder()->firstOrFail();
 
                 $follow = new Follower;
                 $follow->profile_id = $actor->id;