Download the PHP package lanin/laravel-hashids without Composer

On this page you can find all versions of the php package lanin/laravel-hashids. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-hashids

Laravel-Hashids

Easily integrate Laravel with Hashids with full model support.

There are lots of packages for integrating Hashids with Laravel, but all of them just provide you with facade and add some syntax sugar.

But what about model binding and automatic id resolving? This package gives you all. All you have to do is just to install it!

Installation

PHP 5.4+ or HHVM 3.3+, Composer and Laravel 5.0+ are required.

To get the latest version of Laravel Laravel-Hashids, simply install it via composer.

Once Laravel-Hashids is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.

The last thing is to add \Lanin\Laravel\Hashids\UseHashidsRouter trait to your App\Http\Kernel. This will force Laravel to use package router to dispatch the route.

Also you can register HashidsFacade for easier access to the Hashids methods.

Usage

You don't have to modify anything in your routes or html to make it run. If you are using model bindings and route resolving in html, everything will convert automatically.

Binding

After the installation, Router's method model that binds your placeholders ids to the models will be updated to automatically support hashids and convert them to the internal integer ids.

Routing

If you will pass hash id to the url it will be easily resolved into an associated model. But how replace ids in your html output? There are two ways. Everything depends on how you form your urls.

If you prefer form them by hands, package gives you the Blade helper method @hashids($id) that will convert your id to the hash string.

But this method is tedious. And I prefer using awesome Laravel feature that automatically extracts ids from models and inserts them into your urls. Example:

This methods were updated to handle Hashids too. They will automatically replace integer ids from your models to Hashids.

If for some reason you don't want to convert them, just implement \Lanin\Laravel\Hashids\DoNotUseHashids interface in your model.

Configuration

By default package will use your APP_KEY as a salt and 5 symbols length for the hash. If you want to overwrite it, publish hashids configs and edit config/hahshids.php

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.


All versions of laravel-hashids with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version ~5.0
hashids/hashids Version 1.0.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lanin/laravel-hashids contains the following files

Loading the files please wait ....