12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
-
- namespace Database\Factories\Setting;
-
- use App\Models\Setting\DocumentDefault;
- use Illuminate\Database\Eloquent\Factories\Factory;
-
- /**
- * @extends Factory<DocumentDefault>
- */
- class DocumentDefaultFactory extends Factory
- {
- /**
- * The name of the factory's corresponding model.
- *
- * @var string
- */
- protected $model = DocumentDefault::class;
-
- /**
- * Define the model's default state.
- *
- * @return array<string, mixed>
- */
- public function definition(): array
- {
- return [
- //
- ];
- }
-
- /**
- * Indicate that the model's type is invoice.
- *
- * @return DocumentDefaultFactory
- */
- public function invoice(): self
- {
- return $this->state([
- 'type' => 'invoice',
- 'number_prefix' => 'INV-',
- 'header' => 'Invoice',
- 'item_name' => [
- 'option' => 'items',
- 'custom' => null,
- ],
- 'unit_name' => [
- 'option' => 'quantity',
- 'custom' => null,
- ],
- 'price_name' => [
- 'option' => 'price',
- 'custom' => null,
- ],
- 'amount_name' => [
- 'option' => 'amount',
- 'custom' => null,
- ],
- ]);
- }
-
- /**
- * Indicate that the model's type is bill.
- *
- * @return DocumentDefaultFactory
- */
- public function bill(): self
- {
- return $this->state([
- 'type' => 'bill',
- 'number_prefix' => 'BILL-',
- 'header' => 'Bill',
- 'item_name' => [
- 'option' => 'items',
- 'custom' => null,
- ],
- 'unit_name' => [
- 'option' => 'quantity',
- 'custom' => null,
- ],
- 'price_name' => [
- 'option' => 'price',
- 'custom' => null,
- ],
- 'amount_name' => [
- 'option' => 'amount',
- 'custom' => null,
- ],
- ]);
- }
- }
|