Download the PHP package mcris112/laravel-hashidable without Composer

On this page you can find all versions of the php package mcris112/laravel-hashidable. 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-hashidable

Laravel Hashidable

Laravel Hashidable uses Hashidable as main source

_I made this package because the main package from above never has been updated, that has a mistake in declaring types so when you want to use User::whereHashid()

Installation

Note: This package is built to work with Laravel versions greater than 7. It may work in older version, but this has not been tested.

Setup

Import the Hashidable trait and add it to your model.

Usage

WhereHashid

This function needs two parameters.

$hashid needs to be a string and refers a plain hashed id text $columnId needs to be a string in case that your primary key It is different

Route Model Binding

Assuming we have a route resource defined as follows:

This package does not affect route model bindings, the only difference is, instead of placing the id in the generated route, it uses the hashid instead.

So, route('users.show', $user) returns /users/3RwQaeoOR1E7qjYy;

When you define your controller that auto-resolves a model in the parameters, it will work as always.

Configuring

First, publish the config file using:

The available configuration options are:

Per-Model Configuration

You can also extend the global configuration on a per-model basis. To do this, your model should implement the Mcris112\LaravelHashidable\HashidableConfigInterface and define the hashidableConfig() method on the model.

This method returns an array or subset of options similar to the global configuration.

FAQs

Where are the generated hashes stored? Hashidable does not touch the database to store any sort of metadata. What it does instead is use an internal encoder/decoder to dynamically calculate the hashes.

License

MIT


All versions of laravel-hashidable with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
hashids/hashids Version ^4.0
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 mcris112/laravel-hashidable contains the following files

Loading the files please wait ....