CRM - tp 1,2, et 3 bientot fini refresh
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
use App\Models\Client;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class ClientSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
Client::create([
|
||||
'name' => 'Jean Dupont',
|
||||
'email' => 'jean@example.com',
|
||||
'city' => 'Paris'
|
||||
]);
|
||||
Client::create([
|
||||
'name' => 'Marie Martin',
|
||||
'email' => 'marie@example.com',
|
||||
'city' => 'Lyon'
|
||||
]);
|
||||
Client::create([
|
||||
'name' => 'Paul Durand',
|
||||
'email' => 'paul@example.com',
|
||||
'city' => 'Bordeaux'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,15 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// User::factory(10)->create();
|
||||
// // User::factory(10)->create();
|
||||
// $this->call([
|
||||
// ClientSeeder::class,
|
||||
// ]);
|
||||
|
||||
$this->call([
|
||||
ProductSeeder::class,
|
||||
]);
|
||||
|
||||
User::factory()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\Product;
|
||||
|
||||
class ProductSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
Product::create([
|
||||
'name' => 'Ordinateur',
|
||||
'price' => 899,
|
||||
'stock' => 12
|
||||
]);
|
||||
|
||||
Product::create([
|
||||
'name' => 'Écran',
|
||||
'price' => 249,
|
||||
'stock' => 7
|
||||
]);
|
||||
|
||||
Product::create([
|
||||
'name' => 'Clavier',
|
||||
'price' => 79,
|
||||
'stock' => 25
|
||||
]);
|
||||
|
||||
Product::create([
|
||||
'name' => 'Souris',
|
||||
'price' => 39,
|
||||
'stock' => 42
|
||||
]);
|
||||
|
||||
Product::create([
|
||||
'name' => 'Webcam',
|
||||
'price' => 99,
|
||||
'stock' => 4
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user