forked from eatvio/eatvio-infra
Author is now random
This commit is contained in:
@@ -6,6 +6,7 @@ use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\Recipe;
|
||||
use App\Models\RecipeAuthor;
|
||||
use App\Models\User;
|
||||
use Faker\Factory as FakerFaktory;
|
||||
use DB;
|
||||
|
||||
@@ -41,7 +42,7 @@ class RecipeSeeder extends Seeder
|
||||
$recipe->save();
|
||||
DB::table('recipe_author')->insert([
|
||||
'recipe_id' => $recipe->id,
|
||||
'user_id' => 3
|
||||
'user_id' => User::inRandomOrder()->first()->id
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user