Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

CompanyFactory.php 619B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Database\Factories;
  3. use App\Models\{Company, User};
  4. use Illuminate\Database\Eloquent\Factories\Factory;
  5. class CompanyFactory extends Factory
  6. {
  7. /**
  8. * The name of the factory's corresponding model.
  9. *
  10. * @var string
  11. */
  12. protected $model = Company::class;
  13. /**
  14. * Define the model's default state.
  15. *
  16. * @return array<string, mixed>
  17. */
  18. public function definition(): array
  19. {
  20. return [
  21. 'name' => $this->faker->unique()->company(),
  22. 'user_id' => User::factory(),
  23. 'personal_company' => true,
  24. ];
  25. }
  26. }