{"id":17966217,"url":"https://github.com/markwalet/laravel-hashed-route","last_synced_at":"2026-03-11T19:02:58.211Z","repository":{"id":27134175,"uuid":"112489141","full_name":"markwalet/laravel-hashed-route","owner":"markwalet","description":"A Laravel package that replaces the default route model binding for a safer version.","archived":false,"fork":false,"pushed_at":"2023-07-06T18:15:37.000Z","size":116,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-14T12:27:05.435Z","etag":null,"topics":["laravel","php","php-library","security"],"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/markwalet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"markwalet","custom":["https://www.paypal.me/markwalet"]}},"created_at":"2017-11-29T15:00:06.000Z","updated_at":"2023-11-04T23:32:32.000Z","dependencies_parsed_at":"2022-07-27T09:22:14.131Z","dependency_job_id":null,"html_url":"https://github.com/markwalet/laravel-hashed-route","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Flaravel-hashed-route","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Flaravel-hashed-route/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Flaravel-hashed-route/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwalet%2Flaravel-hashed-route/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markwalet","download_url":"https://codeload.github.com/markwalet/laravel-hashed-route/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222016696,"owners_count":16916812,"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","php-library","security"],"created_at":"2024-10-29T13:08:27.528Z","updated_at":"2026-03-11T19:02:56.078Z","avatar_url":"https://github.com/markwalet.png","language":"PHP","funding_links":["https://github.com/sponsors/markwalet","https://www.paypal.me/markwalet"],"categories":[],"sub_categories":[],"readme":"[![Laravel hashed route](https://banners.beyondco.de/Laravel%20hashed%20route.png?theme=light\u0026packageName=markwalet%2Flaravel-hashed-route\u0026pattern=circuitBoard\u0026style=style_1\u0026description=A+Laravel+package+that+replaces+the+default+route+model+binding+for+a+safer+version.\u0026md=0\u0026showWatermark=0\u0026fontSize=100px\u0026images=https%3A%2F%2Flaravel.com%2Fimg%2Flogomark.min.svg\u0026widths=200\u0026heights=auto)](http://github.com/markwalet/laravel-hashed-route)\n\n[![MIT Licensed](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Latest Stable Version](https://poser.pugx.org/markwalet/laravel-hashed-route/v/stable)](https://packagist.org/packages/markwalet/laravel-hashed-route)\n[![Build status](https://img.shields.io/github/actions/workflow/status/markwalet/laravel-hashed-route/tests.yml?branch=master)](https://github.com/markwalet/laravel-hashed-route/actions)\n[![Coverage](https://codecov.io/gh/markwalet/laravel-hashed-route/branch/master/graph/badge.svg)](https://codecov.io/gh/markwalet/laravel-hashed-route)\n[![StyleCI](https://github.styleci.io/repos/112489141/shield?branch=master)](https://github.styleci.io/repos/112489141)\n[![Total Downloads](https://poser.pugx.org/markwalet/laravel-hashed-route/downloads)](https://packagist.org/packages/markwalet/laravel-hashed-route)\n\nA Laravel package that replaces the default route model binding for a safer version.\n\n## Installation\nYou can install this package with composer:\n\n```shell\ncomposer require markwalet/laravel-hashed-route\n```\n\nLaravel 5.5 uses Package auto-discovery, so you don't have to register the service provider. If you want to register the service provider manually, add the following line to your `config/app.php` file:\n\n```php\nMarkWalet\\LaravelHashedRoute\\HashedRouteServiceProvider::class\n```\n\n## Usage\nWhen you want to hash the routes for a given model. The only thing you have to is is adding the `HasHashedRouteKey` trait:\n\n```php\nuse MarkWalet\\LaravelHashedRoute\\Concerns\\HasHashedRouteKey;\n\nclass TestModel extends Model\n{\n    use HasHashedRouteKey;\n    \n    //...\n}\n```\n\nAfter that you can use the model like you normally would. Because the trait overrides the `resolveRouteBinding()` and `getRouteKey()` methods, no extra changes are required to your code.\n\nYou do have to change your code when you are building your urls by manually getting the `$model-\u003eid` property from your model. Then you will have to change those calls to `$model-\u003egetRouteKey()`.\n\n## Configuration\nThe default configuration is defined in `hashed-route.php`. If you want to edit this file you can copy it to your config folder by using the following command:\n```shell\nphp artisan vendor:publish --provider=\"MarkWalet\\LaravelHashedRoute\\HashedRouteServiceProvider\"\n```\n\nIn this file you can configure different codecs for the encoding and decoding of keys, as well as setting a default configuration.\n\nYou can override this configuration by setting the `codec` property on your model.\n\nThe supported codec drivers are: `null`, `hashids`, `optimus` \u0026 `base64`. Use the `null` driver if you want to disable route key hashing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwalet%2Flaravel-hashed-route","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkwalet%2Flaravel-hashed-route","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwalet%2Flaravel-hashed-route/lists"}