Download the PHP package shikachuu/laravel-cuid2 without Composer

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

Laravel CUID2

The missing CUID2 implementation for your Laravel apps.

Secure, collision-resistant ids, basically the next generation UUIDs.

Installation

You can install the package via composer:

You can publish the configuration file with:

The configuration file will be published in config/cuid2.php, in this file you can change the default key-length which is set to 24 by default.

Usage

Basic usage via Facade or a helper function

This is the simplest way to create a new CUID2 in your Laravel app.

You can use the provided facades and a helper function:

Now let's validate our example above:

Validation

You can use the provided cuid2 validation rule in the default Laravel's Validator:

Migrations

You can use cuid2 and foreignCuid2 as field types in your migrations:

By default, these rules will create a filed cuid2, but you have the ability to customize this behaviour by defining the column name explicitly:

Models

Just like UUIDs, you can also use CUID2 in your models to automatically generate and validate IDs in your queries:

License

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

Contributing

Here are a few guidelines for contributing:

To test your changes use the included composer test command, please always cover your changes with appropriate test cases, prefer table tests when possible.

Example files are always a welcome addition in the workbench folder. Feel free to provide example use cases for your fix/feature.

All tests and code in this repo are should be able to run in a raw php:8.2-cli-alpine container using on OCI runtime. (In my case: podman run --rm -it -v $PWD:/app:Z -w /app php:8.2-cli-alpine ash) this might be replaced in the future, with devcontainers or a bake file.


All versions of laravel-cuid2 with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^v10
visus/cuid2 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 shikachuu/laravel-cuid2 contains the following files

Loading the files please wait ....