Add Notes model, controller and database table. Implement it in Customer Dialog, #6
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
use App\Models\User;
|
||||
use App\Models\Customer;
|
||||
use App\Models\Contact;
|
||||
use App\Models\Note;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\LineItem;
|
||||
|
||||
@@ -21,14 +22,14 @@ public function run(): void
|
||||
SettingsTableSeeder::class
|
||||
]);
|
||||
|
||||
User::factory()->create([
|
||||
$user = User::factory()->create([
|
||||
'name' => 'Daniel Stock',
|
||||
'email' => 'daniel.stock@tooloop.de',
|
||||
'password' => bcrypt('6T0az2JGO5oA'),
|
||||
]);
|
||||
|
||||
// Create customers with contacts
|
||||
Customer::factory(20)->create()->each(function ($customer) {
|
||||
Customer::factory(20)->create()->each(function ($customer) use ($user) {
|
||||
// Create a primary contact for each customer
|
||||
Contact::factory()->create([
|
||||
'customer_id' => $customer->id,
|
||||
@@ -39,6 +40,13 @@ public function run(): void
|
||||
Contact::factory(rand(1, 3))->create([
|
||||
'customer_id' => $customer->id,
|
||||
]);
|
||||
|
||||
|
||||
// Create some notes for each customer
|
||||
Note::factory(rand(0, 5))->create([
|
||||
'user_id' => $user->id,
|
||||
'customer_id' => $customer->id,
|
||||
]);
|
||||
});
|
||||
|
||||
// Create invoices
|
||||
|
||||
Reference in New Issue
Block a user