2017 © Pedro Peláez
 

library laravel-hashed-route

A Laravel package that replaces the default route model binding for a safer version.

image

markwalet/laravel-hashed-route

A Laravel package that replaces the default route model binding for a safer version.

  • Friday, April 13, 2018
  • by markwalet
  • Repository
  • 1 Watchers
  • 0 Stars
  • 72 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

Laravel hashed route, (*1)

MIT Licensed Latest Stable Version Build status Coverage StyleCI Total Downloads, (*2)

A Laravel package that replaces the default route model binding for a safer version., (*3)

Installation

You can install this package with composer:, (*4)

composer require markwalet/laravel-hashed-route

Laravel 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:, (*5)

MarkWalet\LaravelHashedRoute\HashedRouteServiceProvider::class

Usage

When you want to hash the routes for a given model. The only thing you have to is is adding the HasHashedRouteKey trait:, (*6)

use MarkWalet\LaravelHashedRoute\Concerns\HasHashedRouteKey;

class TestModel extends Model
{
    use HasHashedRouteKey;

    //...
}

After 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., (*7)

You do have to change your code when you are building your urls by manually getting the $model->id property from your model. Then you will have to change those calls to $model->getRouteKey()., (*8)

Configuration

The 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:, (*9)

php artisan vendor:publish --provider="MarkWalet\LaravelHashedRoute\HashedRouteServiceProvider"

In this file you can configure different codecs for the encoding and decoding of keys, as well as setting a default configuration., (*10)

You can override this configuration by setting the codec property on your model., (*11)

The supported codec drivers are: null, hashids, optimus & base64. Use the null driver if you want to disable route key hashing., (*12)

The Versions

13/04 2018

dev-master

9999999-dev

A Laravel package that replaces the default route model binding for a safer version.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url security id hash codec

01/12 2017

v1.1.7

1.1.7.0

A Laravel package that replaces the default route model binding for a safer version.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url security id hash

01/12 2017

v1.1.6

1.1.6.0

A Laravel package that replaces the default route model binding for a safer version.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url security id hash

01/12 2017

v1.1.5

1.1.5.0

A Laravel package that replaces the default route model binding for a safer version.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url security id hash

01/12 2017

v1.1.4

1.1.4.0

A Laravel package that replaces the default route model binding for a safer version.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url security id hash

01/12 2017

v1.1.3

1.1.3.0

A Laravel package that replaces the default route model binding for a safer version.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url security id hash

01/12 2017

v1.1.2

1.1.2.0

A Laravel package that replaces the default route model binding for a safer version.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url security id hash

01/12 2017

v1.1.1

1.1.1.0

A Laravel package that replaces the default route model binding for a safer version.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url security id hash

01/12 2017

v1.1.0

1.1.0.0

A Laravel package that replaces the default route model binding for a safer version.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url security id hash

30/11 2017

v1.0.0

1.0.0.0

A Laravel package that replaces the default route model binding for a safer version.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url security id hash