Seeder pour les menus (15 menus aléatoires)
This commit is contained in:
parent
fe69442efc
commit
e82a9eedc7
@ -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,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user