{"id":20349402,"url":"https://github.com/rootinc/faker-bonus","last_synced_at":"2026-05-28T01:32:11.898Z","repository":{"id":62537310,"uuid":"243634877","full_name":"rootinc/faker-bonus","owner":"rootinc","description":"Extra Faker Formatters/Providers for PHP","archived":false,"fork":false,"pushed_at":"2020-03-04T15:30:46.000Z","size":54,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-21T07:47:28.852Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/rootinc.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}},"created_at":"2020-02-27T23:06:27.000Z","updated_at":"2024-07-20T03:05:35.000Z","dependencies_parsed_at":"2022-11-02T15:15:51.256Z","dependency_job_id":null,"html_url":"https://github.com/rootinc/faker-bonus","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rootinc/faker-bonus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootinc%2Ffaker-bonus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootinc%2Ffaker-bonus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootinc%2Ffaker-bonus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootinc%2Ffaker-bonus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootinc","download_url":"https://codeload.github.com/rootinc/faker-bonus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootinc%2Ffaker-bonus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33590884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-11-14T22:25:46.851Z","updated_at":"2026-05-28T01:32:11.884Z","avatar_url":"https://github.com/rootinc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# faker-bonus\n\n[![Codeship Status for rootinc/faker-bonus](https://app.codeship.com/projects/3d1428a0-3f07-0138-f2a1-0a35e539f0bc/status?branch=master)](https://app.codeship.com/projects/387568)\n\nA handy set of extra Faker Formatters/Providers for [fzaninotto/faker](https://github.com/fzaninotto/faker) built to integrate with Laravel or\nany PHP project that uses Faker.\n\n## Contents\n1. [Installation](#installation) \n1. [Usage](#basic-usage) \n    1. [Basic Usage](#basic-usage) \n    1. [Laravel Installation](#laravel-usage) \n1. [Formatters](#formatters)\n    1. [Hashtag](#hashtag) \n    1. [Mention](#mention) \n    1. [Tweet Text](#tweet-text) \n1. [Testing](#testing)\n1. [Acknowledgements](#acknowledgement)\n\n## Installation\n\n```bash\ncomposer install rootinc/faker-bonus --dev\n```\n\n## Usage\n\nWe can add new Providers directly to the Faker instance before we use it:\n### Basic Usage\n\n```php\n\u003c?php\n$faker = Faker\\Factory::create();\nProviderCollectionHelper::addAllProvidersTo($faker);\n// Use Faker\n$faker-\u003ehashtag;\n```\n\n#### Specific Provider/s\n```php\n\u003c?php\n$faker = Faker\\Factory::create();\n$faker-\u003eaddProvider(new Provider\\Hashtag($faker));\n//...\n// Add more Providers \n//...\n// Use Faker\n$faker-\u003ehashtag;\n```\n\n### Laravel Usage\n\nWe can have Providers/Formatters added to all instances of `Faker\\Generator` by updating our `AppServiceProvier` as follows:\n\n#### All Providers\n\napp/Providers/AppServiceProvider.php\n```php\n\u003c?php\n\nuse Faker\\Generator;\n\npublic function register() {\n  //...\n  // Whenever Faker\\Generator is called, substitute the return value of this block\n  $this-\u003eapp-\u003eextend(Generator::class, function ($generator) {\n      // Add Providers to the Faker\\Generator class\n      ProviderCollectionHelper::addAllProvidersTo($generator);\n      // Return modified Faker\\Generator\n      return $generator;\n  });\n  //...\n}\n```\n\n## Formatters\n\n### Hashtag\n\nBuild some fun hashtags.\n\n#### Definition\n```php\n$faker-\u003ehashtag($includeTag = true)\n```\n#### Usage\n```php\n$faker-\u003ehashtag // '#this_is_fun'\n$faker-\u003ehashtag(false) // 'this_is_fun'\n\n```\n\n### Mention\n\nBuilds handle-ish mentions.\n\n#### Definition\n```php\n$faker-\u003emention($includeAt = true)\n```\n#### Usage\n```php\n$faker-\u003emention // '@bartoletti.barbara'\n$faker-\u003emention(false) // 'bartoletti.barbara'\n\n```\n\n### Tweet Text\n\nCreate tweet-like text.\n\n#### Definition\n```php\n$faker-\u003etweetText($nbParagraphs = 1, $includeEmoji = true)\n```\n#### Usage\n```php\n$faker-\u003etweetText // '@BSCHADEN The a my were anchors for consider that one man perfectly. 😀 #EXPLOIT_CUTTINGEDGE_EYEBALLS'\n$faker-\u003etweetText(2) // '@BSCHADEN The a my were anchors for consider that one man perfectly.\\n\\n Created, rung and over flows let four it lane.😀 #EXPLOIT_CUTTINGEDGE_EYEBALLS'\n$faker-\u003etweetText(3, false) // '@BSCHADEN The a my were anchors for consider that one man perfectly.\\n\\n Created, rung and over flows let four it lane.\\n\\n Created, rung and over flows let four it lane. #EXPLOIT_CUTTINGEDGE_EYEBALLS'\n```\n\n## Testing\n\n```bash\ncomposer install\nvendor/bin/phpunit\n```\n\n## Acknowledgements\n\n- Influenced by: [mbezhanov/faker-provider-collection](https://github.com/mbezhanov/faker-provider-collection)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootinc%2Ffaker-bonus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootinc%2Ffaker-bonus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootinc%2Ffaker-bonus/lists"}