You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.7 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <?php
  2. namespace Database\Factories;
  3. use DateTime;
  4. use Illuminate\Database\Eloquent\Factories\Factory;
  5. /**
  6. * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Collection>
  7. */
  8. class CollectionFactory extends Factory
  9. {
  10. use BaseFactory;
  11. /**
  12. * Define the model's default state.
  13. *
  14. * @return array<string, mixed>
  15. */
  16. public function definition()
  17. {
  18. return [
  19. "name" => fake()->name(),
  20. "public" => "public",
  21. "disk" => "local",
  22. "count" => rand(3, 18),
  23. "tmp_support" => rand(0, 1),
  24. "remove_tmp_time" => 132,
  25. "max_file_size" => rand(300, 2000),
  26. "min_file_size" => rand(300, 2000),
  27. "max_width" => rand(300, 2000),
  28. "min_width" => rand(300, 2000),
  29. "max_height" => rand(300, 2000),
  30. "min_height" => rand(300, 2000),
  31. "alt_required" => rand(0, 1),
  32. "description_required" => rand(0, 1),
  33. "exts" => [
  34. "jpg",
  35. "jpeg",
  36. "png",
  37. "webp"
  38. ],
  39. "ext" => "webp",
  40. "mimetypes" => [
  41. "image/webp",
  42. "image/png",
  43. "image/jpeg",
  44. "image/jpg"
  45. ],
  46. "model" => fake()->name(),
  47. "expire_date" => "2022-07-27 09:17:59"
  48. ];
  49. }
  50. public function testGeneratorConfig()
  51. {
  52. return [
  53. 'store' => '',
  54. 'update' => '',
  55. 'show' => '',
  56. 'delete' => '',
  57. ];
  58. }
  59. public function dependencyProvider()
  60. {
  61. return [];
  62. }
  63. public function list()
  64. {
  65. return [
  66. 'name:gt'
  67. ];
  68. }
  69. }