Seeder pour les menus (15 menus aléatoires)

This commit is contained in:
Olivier DOSSMANN 2021-04-27 19:12:13 +02:00
parent fe69442efc
commit e82a9eedc7
3 changed files with 4 additions and 2 deletions

View File

@ -22,7 +22,7 @@ class MenuFactory extends Factory
public function definition() public function definition()
{ {
return [ return [
'title' => $this->faker->unique()->title, 'title' => $this->faker->name,
]; ];
} }
} }

View File

@ -14,5 +14,6 @@ class DatabaseSeeder extends Seeder
public function run() public function run()
{ {
// \App\Models\User::factory(10)->create(); // \App\Models\User::factory(10)->create();
$this->call(MenuSeeder::class);
} }
} }

View File

@ -2,6 +2,7 @@
namespace Database\Seeders; namespace Database\Seeders;
use App\Models\Menu;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
class MenuSeeder extends Seeder class MenuSeeder extends Seeder
@ -13,6 +14,6 @@ class MenuSeeder extends Seeder
*/ */
public function run() public function run()
{ {
// Menu::factory()->count(15)->create();
} }
} }