{"id":18310301,"url":"https://github.com/torann/laravel-hashids","last_synced_at":"2025-04-10T03:54:33.420Z","repository":{"id":13521988,"uuid":"16213179","full_name":"Torann/laravel-hashids","owner":"Torann","description":"Laravel package for Hashids","archived":false,"fork":false,"pushed_at":"2024-03-22T18:48:10.000Z","size":29,"stargazers_count":54,"open_issues_count":0,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-10T03:54:28.516Z","etag":null,"topics":["hashids","laravel"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"lihaoyi/upickle-pprint","license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Torann.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}},"created_at":"2014-01-24T18:37:23.000Z","updated_at":"2024-09-18T10:36:40.000Z","dependencies_parsed_at":"2024-03-22T19:53:17.648Z","dependency_job_id":"d694ebab-779d-4f7a-9fda-06e9b95a2900","html_url":"https://github.com/Torann/laravel-hashids","commit_stats":{"total_commits":31,"total_committers":3,"mean_commits":"10.333333333333334","dds":"0.16129032258064513","last_synced_commit":"7f2f75ca6be1c46a5adc28e75e0ea08f8a41827e"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Flaravel-hashids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Flaravel-hashids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Flaravel-hashids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Flaravel-hashids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Torann","download_url":"https://codeload.github.com/Torann/laravel-hashids/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154999,"owners_count":21056542,"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":["hashids","laravel"],"created_at":"2024-11-05T16:14:01.405Z","updated_at":"2025-04-10T03:54:33.390Z","avatar_url":"https://github.com/Torann.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hashids for Laravel\n\n[![Latest Stable Version](https://poser.pugx.org/torann/hashids/v/stable.png)](https://packagist.org/packages/torann/hashids) [![Total Downloads](https://poser.pugx.org/torann/hashids/downloads.png)](https://packagist.org/packages/torann/hashids)\n\nThis package uses the classes created by [hashids.org](http://www.hashids.org/ \"http://www.hashids.org/\")\n\nGenerate hashes from numbers, like YouTube or Bitly. Use hashids when you do not want to expose your database ids to the user.\n\n----------\n\n## Installation\n\n- [Hashids on Packagist](https://packagist.org/packages/torann/hashids)\n- [Hashids on GitHub](https://github.com/torann/laravel-hashids)\n\n### Composer\n\nFrom the command line run:\n\n```bash\n$ composer require torann/hashids\n```\n\n**Without Package Auto-Discovery**\n\nOnce Hashids is installed you need to register the service provider and facade with the application. Open up `config/app.php` and find the `providers` and `aliases` keys.\n\n```php\n'providers' =\u003e [\n    Torann\\Hashids\\HashidsServiceProvider::class,\n]\n\n'aliases' =\u003e [\n    'Hashids' =\u003e Torann\\Hashids\\Facade\\Hashids::class,\n]\n```\n\n### Publish the configurations\n\nRun this on the command line from the root of your project:\n\n```\n$ php artisan vendor:publish --provider=\"Torann\\Hashids\\HashidsServiceProvider\"\n```\n\nA configuration file will be publish to `config/hashids.php`.\n\n## Usage\n\nOnce you've followed all the steps and completed the installation you can use Hashids.\n\n### Encoding\n\nYou can simply encode a single id:\n\n```php\nHashids::encode(1); // Returns Ri7Bi\n```\n\nor multiple..\n\n```php\nHashids::encode(1, 21, 12, 12, 666); // Returns MMtaUpSGhdA\n```\n\n### Decoding\n\n```php\nHashids::decode(Ri7Bi);\n\n// Returns\narray (size=1)\n0 =\u003e int 1\n```\n\nor multiple..\n\n```php\nHashids::decode(MMtaUpSGhdA);\n\n// Returns\narray (size=5)\n0 =\u003e int 1\n1 =\u003e int 21\n2 =\u003e int 12\n3 =\u003e int 12\n4 =\u003e int 666\n```\n\nAll credit for Hashids goes to Ivan Akimov (@ivanakimov), thanks to for making it!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorann%2Flaravel-hashids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorann%2Flaravel-hashids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorann%2Flaravel-hashids/lists"}