Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vdlp/oc-hashids-plugin
Allows developers to use secure hashed ID's in October CMS powered websites.
https://github.com/vdlp/oc-hashids-plugin
hashids hashing laravel october-cms octobercms octobercms-plugin php security
Last synced: about 4 hours ago
JSON representation
Allows developers to use secure hashed ID's in October CMS powered websites.
- Host: GitHub
- URL: https://github.com/vdlp/oc-hashids-plugin
- Owner: vdlp
- License: gpl-2.0
- Created: 2019-01-18T10:53:18.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-14T13:48:06.000Z (8 months ago)
- Last Synced: 2024-03-14T14:53:35.668Z (8 months ago)
- Topics: hashids, hashing, laravel, october-cms, octobercms, octobercms-plugin, php, security
- Language: PHP
- Homepage:
- Size: 40 KB
- Stars: 4
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Vdlp.Hashids
Allows developers to use secure hashed ID's.
Fetches RSS/Atom feeds to put on your website. It can be automated using a cronjob or triggered manually.
It converts numbers like 347 into strings like "yr8", or array of numbers like [27, 986] into "3kTMd".
You can also decode those ids back. This is useful in bundling several parameters into one or simply using them as short UIDs.
## Requirements
* PHP 8.0.2 or higher
* October CMS 2.x or higher## Installation
```
composer require vdlp/oc-hashids-plugin
```## Configuration
To configure this plugin execute the following command:
```
php artisan vendor:publish --provider="Vdlp\Hashids\ServiceProvider" --tag="config"
```This will create a `config/hashids.php` file in your app where you can modify the configuration.
## Example
Here you can see an example of how to use this plugin. Out of the box, the default configuration used is `main`.
```
// You can use this class with Dependency Injection
use Vdlp\Hashids\Classes\HashidsManager;/** @var HashidsManager $hashids */
$hashidsManager = resolve(HashidsManager::class);// Encodes the integer 1 to a hashid using the default configuration
$hashidsManager->encode(1);
$hashidsManager->instance()->encode(1);// Encodes the integer 1 to a hashid using a different configuration
$hashidsManager->instance('different-configuration')->encode(1);
```## Questions? Need help?
If you have any question about how to use this plugin, please don't hesitate to contact us at [email protected]. We're happy to help you. You can also visit the support forum and drop your questions/issues there.