Download the PHP package jaacu/laravel-model-hashids without Composer
On this page you can find all versions of the php package jaacu/laravel-model-hashids. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-model-hashids
Laravel Model Hash Id
Compatible with laravel version 5.8.x
This package allows you to use hashids in your models using the vinkla/laravel-hashids package
This package includes the vinkla/laravel-hashids package
Installation
You can install the package via composer:
Usage
Add to your model migration the following code
Then simply add the UsesHashIds trait to your model
Now using default laravel routing implicint binding will use the hashid insted of the normal id
Examples
A model using the trait UsesHashIds
Generating url
Getting the hashid
Config
Publish the config file to change default behavior
By default the generated hashid follows this structure: app name + model name + model id hash
- app name is set by the app.config name and can be overwritten by setting a new 'short_name' in the config/app.php file
- model name is set by the model class name
- model hash id is set by the model 'id' hash
This package shares the config file from vinkla/laravel-hashids
In the config/hashids.php you can set the hash length and salt.
Docs
For more info on the hash functionality see vinkla/laravel-hashids
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Javier Cabello
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.