{"id":28385867,"url":"https://github.com/teariot/faker-fillthis","last_synced_at":"2026-03-16T11:38:07.985Z","repository":{"id":284133784,"uuid":"941141246","full_name":"TeaRiot/Faker-FillThis","owner":"TeaRiot","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-05T10:58:43.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T13:45:44.884Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TeaRiot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-01T15:35:47.000Z","updated_at":"2025-05-05T10:58:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b838b24-a769-4e93-8d60-426752fafce0","html_url":"https://github.com/TeaRiot/Faker-FillThis","commit_stats":null,"previous_names":["teariot/faker-fillthis"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/TeaRiot/Faker-FillThis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeaRiot%2FFaker-FillThis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeaRiot%2FFaker-FillThis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeaRiot%2FFaker-FillThis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeaRiot%2FFaker-FillThis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TeaRiot","download_url":"https://codeload.github.com/TeaRiot/Faker-FillThis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeaRiot%2FFaker-FillThis/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262018760,"owners_count":23245620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-30T11:45:00.302Z","updated_at":"2026-03-16T11:38:02.942Z","avatar_url":"https://github.com/TeaRiot.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FakerFillThis\n\nFakerFillThis is a custom Faker provider for generating placeholder image URLs and downloading images from [fillthis.io](https://fillthis.io). This provider conforms to the Laravel Faker interface for `imageUrl`, `image`, and `url` methods.\n\n## Installation\n\nInstall via Composer:\n\n```bash\n  composer require teariot/faker-fillthis\n```\n\n## Usage\n\nAdd the provider to your Faker instance:\n\n```php\nuse Faker\\Factory;\nuse TeaRiot\\FakerFillThis\\Faker\\Provider\\FillThisImage;\n\n$faker = Factory::create();\n$faker-\u003eaddProvider(new FillThisImage($faker));\n```\n\n### Generating an Image URL\n\n- **Default Image:** Returns the default endpoint.\n  ```php\n  echo $faker-\u003eimageUrl(0, 0);\n  ```\n- **Custom Dimensions:** For a 500x500 image.\n  ```php\n  echo $faker-\u003eimageUrl(500, 500, null, false, null, false, \"png\");\n  ```\n- **With Random Word:** Appends a random word to the text parameter.\n  ```php\n  echo $faker-\u003eimageUrl(800, 600, null, true, null, false, \"png\");\n  ```\n- **Category-based Image:** When specifying a category (e.g., \"fashion\" or \"all\"), the library generates a URL with a seed that directly points to an image from that category. Note that in this mode, the width and height parameters are ignored. This approach is implemented for improved performance by avoiding the need to resize images.\n  ```php\n  echo $faker-\u003eimageUrl(0, 0, \"fashion\", false, null, false, \"png\");\n  ```\n\n### Generating a Video URL\n\nWhen the type is set to `\"video\"`, the URL will include a `.mp4` extension for clear identification:\n\n```php\necho $faker-\u003eurl('video');\n```\n\n### Downloading an Image\n\nDownload an image to a specified directory (or system temporary directory by default):\n\n```php\n$imagePath = $faker-\u003eimage(__DIR__, 800, 600, null, true, true, \"TestImage\", false, \"png\");\nif ($imagePath !== false) {\n    echo \"Image downloaded at: \" . $imagePath;\n} else {\n    echo \"Error downloading image.\";\n}\n```\n\n## API Reference\n\n- **imageUrl**\n  ```php\n  imageUrl(\n      int $width = 640,\n      int $height = 480,\n      ?string $category = null,\n      bool $randomize = true,\n      ?string $word = null,\n      bool $gray = false,\n      string $format = 'png'\n  ): string\n  ```\n- **url**\n  ```php\n  url(?string $type = null): string\n  ```\n- **image**\n  ```php\n  image(\n      ?string $dir = null,\n      int $width = 640,\n      int $height = 480,\n      ?string $category = null,\n      bool $fullPath = true,\n      bool $randomize = true,\n      ?string $word = null,\n      bool $gray = false,\n      string $format = 'png'\n  ): string|false\n  ```\n\n## Categories\n\n\u003e **Note:** The list of categories is deprecated. To obtain the complete list of categories, call the API at [https://fillthis.io/categories](https://fillthis.io/categories).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteariot%2Ffaker-fillthis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteariot%2Ffaker-fillthis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteariot%2Ffaker-fillthis/lists"}