LibraryFactory.php 772 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Database\Factories;
  3. use App\Models\Asset;
  4. use App\Models\Enums\LibraryACL;
  5. use App\Models\Enums\LibraryType;
  6. use Illuminate\Database\Eloquent\Factories\Factory;
  7. use Illuminate\Support\Facades\Auth;
  8. /**
  9. * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Library>
  10. */
  11. class LibraryFactory extends Factory
  12. {
  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" => fake()->text(10),
  22. "acl" => LibraryACL::CUSTOM->value,
  23. "asset_id" => Asset::factory()->create(),
  24. "company_id" => Auth::user()->company_id,
  25. "type" => LibraryType::ASSET->value,
  26. ];
  27. }
  28. }