您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

CompanyFactory.php 632B

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