FolderFactory.php 669 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Database\Factories;
  3. use App\Models\Library;
  4. use Illuminate\Database\Eloquent\Factories\Factory;
  5. use Illuminate\Support\Facades\Auth;
  6. /**
  7. * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Folder>
  8. */
  9. class FolderFactory extends Factory
  10. {
  11. /**
  12. * Define the model's default state.
  13. *
  14. * @return array<string, mixed>
  15. */
  16. public function definition(): array
  17. {
  18. return [
  19. "library_id" => Library::factory()->create(),
  20. "company_id" => Auth::user()->company_id,
  21. "name" => fake()->name(),
  22. "parent_id" => 0,
  23. "sequence" => 0,
  24. ];
  25. }
  26. }