2017 © Pedro PelĂĄez
 

library hashids-laravel

A hashids (hashids) wrapper for Laravel

image

specs/hashids-laravel

A hashids (hashids) wrapper for Laravel

  • Wednesday, June 29, 2016
  • by Specs
  • Repository
  • 1 Watchers
  • 1 Stars
  • 117 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 4 % Grown

The README.md

Hashids for Laravel

A hashids (hashids) wrapper for Laravel., (*1)

Hashids is a small PHP class to generate YouTube-like ids from one or many numbers. Use hashids when you do not want to expose your database ids to the user., (*2)

Installation

require package in composer.json, (*3)

"require": {
    "specs/hashids-laravel": "^0.1"
},

add hashids’s service provider in config/app.php, (*4)

'providers' => array(

    Illuminate\Validation\ValidationServiceProvider::class,
    ...
    Illuminate\View\ViewServiceProvider::class,

    Specs\Hashids\HashidsServiceProvider::class,
),

and hashids’s facade (also in config/app.php), (*5)

'aliases' => array(

    'App' => Illuminate\Support\Facades\App::class,
    ...
    'View' => Illuminate\Support\Facades\View::class,

    'Hashids' => Specs\Hashids\HashidsFacade::class,

),

You should also publish the config file., (*6)

php artisan vendor:publish --tag=config

And then reset the default values in config/hashids.php., (*7)

Example Usage

Use Hashids Facade:, (*8)

$id = Hashids::encode(1, 2, 3);
$numbers = Hashids::decode($id);

var_dump($id, $numbers);
string(5) "laHquq"
array(3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}

More usage, (*9)

The Versions

29/06 2016

dev-master

9999999-dev https://github.com/specs/hashids-laravel

A hashids (hashids) wrapper for Laravel

  Sources   Download

MIT

The Requires

 

by Avatar Specs

laravel php laravel 5 id hash hashids integer

29/06 2016

0.1.2

0.1.2.0 https://github.com/specs/hashids-laravel

A hashids (hashids) wrapper for Laravel

  Sources   Download

MIT

The Requires

 

by Avatar Specs

laravel php laravel 5 id hash hashids integer

29/06 2016

0.1.1

0.1.1.0 https://github.com/specs/hashids-laravel

A hashids (hashids) wrapper for Laravel

  Sources   Download

MIT

The Requires

 

by Avatar Specs

laravel php laravel 5 id hash hashids integer

29/06 2016

0.1.0

0.1.0.0 https://github.com/specs/hashids-laravel

A hashids (hashids) wrapper for Laravel

  Sources   Download

MIT

The Requires

 

by Avatar Specs

laravel php laravel 5 id hash hashids integer