| 1234567891011121314151617181920212223242526272829 |
- <?php
- namespace Database\Factories;
- use Illuminate\Database\Eloquent\Factories\Factory;
- use App\Models\sale;
- use App\Models\employee;
- /**
- * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\sale>
- */
- class saleFactory extends Factory
- {
- protected $model = sale::class;
- /**
- * Define the model's default state.
- *
- * @return array<string, mixed>
- */
- public function definition(): array
- {
- return [
- 'employee_id' => employee::factory(), // Automatically associate with an Employee
- 'amount' => $this->faker->randomFloat(2, 20, 500), // Sale amount between $20 and $500
- ];
- }
- }
|