vdlp/oc-hashids-plugin

Allows developers to use secure hashed ID's in October CMS powered websites.

Installs: 7 221

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 7

Forks: 0

Open Issues: 0

Type:october-plugin

2.0.1 2021-05-28 14:27 UTC

This package is auto-updated.

Last update: 2021-11-04 09:07:39 UTC


README

68747470733a2f2f706c7567696e732e76646c702e6e6c2f6f63746f626572636d732f69636f6e732f56646c702e486173686964732e737667

Vdlp.Hashids

Allows developers to use secure hashed ID's.

68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f76646c702f6f632d686173686964732d706c7567696e 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f6c6963656e73652f76646c702f6f632d686173686964732d706c7567696e 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f76646c702f6f632d686173686964732d706c7567696e2f6c6174657374 68747470733a2f2f62616467656e2e6e65742f62616467652f636d732f4f63746f626572253230434d53 68747470733a2f2f62616467656e2e6e65742f62616467652f747970652f706c7567696e 68747470733a2f2f706c7567696e732e76646c702e6e6c2f6f63746f626572636d732f62616467652f696e7374616c6c6174696f6e732e7068703f706c7567696e3d76646c702d68617368696473

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 7.2 or higher
  • October CMS build 468 or higher

Installation

CLI:

php artisan plugin:install Vdlp.Hashids

October CMS:

Go to Settings > Updates & Plugins > Install plugins and search for 'Hashids'.

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 octobercms@vdlp.nl. We're happy to help you. You can also visit the support forum and drop your questions/issues there.