- Added InvoiceIndex component for displaying a list of invoices with pagination and search capabilities. - Created InvoiceShareButton component for sharing invoice details via WhatsApp. - Developed InvoicePrint component for printing invoice details. - Defined routes for invoice management including share and print functionalities. - Implemented InvoiceTest to cover authentication, authorization, and CRUD operations for invoices.
22 lines
685 B
PHP
22 lines
685 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class InvoiceFactory extends Factory
|
|
{
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'invoice_number' => 'INV-'.fake()->unique()->numerify('######'),
|
|
'customer_name' => fake()->name(),
|
|
'amount' => fake()->numberBetween(50000, 5000000),
|
|
'date' => fake()->dateTimeBetween('-1 month', 'now')->format('Y-m-d'),
|
|
'due_date' => fake()->dateTimeBetween('now', '+1 month')->format('Y-m-d'),
|
|
'status' => fake()->randomElement(['unpaid', 'paid']),
|
|
'description' => fake()->sentence(),
|
|
];
|
|
}
|
|
}
|