Download the PHP package guava/sqids-for-laravel without Composer

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

Laravel wrapper for Sqids

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Laravel Wrapper for sqids.org PHP library.

Support us

Your support is key to the continual advancement of our plugin. We appreciate every user who has contributed to our journey so far.

While our plugin is available for all to use, if you are utilizing it for commercial purposes and believe it adds significant value to your business, we kindly ask you to consider supporting us through GitHub Sponsors. This sponsorship will assist us in continuous development and maintenance to keep our plugin robust and up-to-date. Any amount you contribute will greatly help towards reaching our goals. Join us in making this plugin even better and driving further innovation.

Installation

You can install the package via composer:

Usage

This package adds a slightly modified version of the Sqids class, which allows a fluent configuration of all options. It also adds a salting option.

Generating Sqids

There's multiple ways you can use this package to generate sqids:

It's entirely up to you which way you prefer. In our examples, we will make use of the factory method.

Using in Eloquent Models

This package also comes with a trait that you can use in your Eloquent models. This trait will automatically add a sqid attribute which will be created from the model's primary key. That's it! Now you can access thesqid` attribute on your model.

You can custimize how the sqid on your model is generated by overriding the getSqids method:

Route binding

If you want to be able to use the sqid as the route key, simply add the HasSqidsRouting trait to your model:

Options

Customizing the alphabet

Customizing the minLength

Customizing the block list

Salting

Salting can be used to generate different IDs based on the provided salt, which can be any string or integer.

Salting is especially useful when used on Models with the HasSqids trait and you want every model to return different, unique IDs.

So for example a record of Model1 with the ID 1 has a different sqid that a record of Model2 with the ID 1.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of sqids-for-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^10.0|^11.0
spatie/laravel-package-tools Version ^1.14.0
sqids/sqids Version ^0.4.1
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 guava/sqids-for-laravel contains the following files

Loading the files please wait ....