{"id":13669270,"url":"https://github.com/kduma-OSS/LV-eloquent-tokenable","last_synced_at":"2025-04-27T01:32:57.802Z","repository":{"id":26646916,"uuid":"30102978","full_name":"kduma-OSS/LV-eloquent-tokenable","owner":"kduma-OSS","description":"Allows using tokens (HashIDs) instead of id in Laravel Eloquent models.","archived":false,"fork":false,"pushed_at":"2024-11-11T18:35:45.000Z","size":12,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-13T13:03:14.816Z","etag":null,"topics":["laravel","php"],"latest_commit_sha":null,"homepage":"https://opensource.duma.sh/libraries/eloquent-tokenable","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/kduma-OSS.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":"2015-01-31T05:10:49.000Z","updated_at":"2024-11-11T18:33:55.000Z","dependencies_parsed_at":"2024-11-13T13:03:19.574Z","dependency_job_id":"24916e30-a881-4bd5-b922-2e2e45afdbab","html_url":"https://github.com/kduma-OSS/LV-eloquent-tokenable","commit_stats":null,"previous_names":["kduma-oss/lv-eloquent-tokenable","kduma/l5-eloquent-tokenable"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kduma-OSS%2FLV-eloquent-tokenable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kduma-OSS%2FLV-eloquent-tokenable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kduma-OSS%2FLV-eloquent-tokenable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kduma-OSS%2FLV-eloquent-tokenable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kduma-OSS","download_url":"https://codeload.github.com/kduma-OSS/LV-eloquent-tokenable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251077102,"owners_count":21532607,"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":["laravel","php"],"created_at":"2024-08-02T08:01:08.149Z","updated_at":"2025-04-27T01:32:56.086Z","avatar_url":"https://github.com/kduma-OSS.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# L5-eloquent-tokenable\n[![Latest Stable Version](https://poser.pugx.org/kduma/eloquent-tokenable/v/stable.svg)](https://packagist.org/packages/kduma/eloquent-tokenable) \n[![Total Downloads](https://poser.pugx.org/kduma/eloquent-tokenable/downloads.svg)](https://packagist.org/packages/kduma/eloquent-tokenable) \n[![Latest Unstable Version](https://poser.pugx.org/kduma/eloquent-tokenable/v/unstable.svg)](https://packagist.org/packages/kduma/eloquent-tokenable) \n[![License](https://poser.pugx.org/kduma/eloquent-tokenable/license.svg)](https://packagist.org/packages/kduma/eloquent-tokenable)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/76ba87c2-d5c1-4516-af23-3d38f2990145/mini.png)](https://insight.sensiolabs.com/projects/76ba87c2-d5c1-4516-af23-3d38f2990145)\n[![StyleCI](https://styleci.io/repos/30102978/shield?branch=master)](https://styleci.io/repos/30102978)\n\nAllows using tokens (HashIDs) instead of id in Laravel Eloquent models.\n\n# Setup\nAdd the package to the require section of your composer.json and run `composer update`\n\n    \"kduma/eloquent-tokenable\": \"^1.1\"\n\n# Prepare models\nIn your model add following lines:\n    \n    use \\KDuma\\Eloquent\\Tokenable;\n    protected $appends = array('token');\n\nOptionally you can add also:\n\n- `protected $salt = 'SALT';`  \nA salt for making hashes. Default is table name. This salt is added to your `APP_KEY`.\n\n- `protected $length = 10;`  \nA salt length. Default is 10.\n\n- `protected $alphabet = 'qwertyuiopasdfghjklzxcvbnm1234567890';`  \nA hash alphabet. Default is `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890`\n\n# Usage\n- `$model-\u003etoken` - Generate tokens\n- `Model::whereToken($id)-\u003efirst()` - Find by token. (`whereToken` is query scope)\n   \n\n# Hashids\n\nA special thanks to creators of [hashids](https://github.com/ivanakimov/hashids.php), a PHP class that this package is based.\n\n\n\n# Packagist\nView this package on Packagist.org: [kduma/eloquent-tokenable](https://packagist.org/packages/kduma/eloquent-tokenable)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkduma-OSS%2FLV-eloquent-tokenable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkduma-OSS%2FLV-eloquent-tokenable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkduma-OSS%2FLV-eloquent-tokenable/lists"}