Download the PHP package alsofronie/eloquent-uuid without Composer

On this page you can find all versions of the php package alsofronie/eloquent-uuid. 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 eloquent-uuid

eloquent-uuid

An Eloquent UUID Trait to use with Laravel 5.1 - 5.4

MIT licensed Total Downloads

It should work with Laravel 5.0 also, but it's untested.

The trait overwrites the static boot method and listens to the creating event. It generates a UUID (strips the dashes) and stores it in the primary key attribute. Thus, you'll need a CHAR(32) primary key for your model (see migrations below).

Installation

composer require alsofronie/eloquent-uuid:dev-master

Use

In order to make it faster, you have the option to use one of three traits:

Using UuidModelTrait

In order to use this trait, your schema must be something like:

Using Uuid32ModelTrait

For this type, just use CHAR(32) in your schema (this is identical to the first one, but with stripped dashes).

Using UuidBinaryModelTrait

This stores the key as binary. The default Laravel Blueprint curretly does not currently support binary fields with specified length, and (at least in MySQL) you cannot create an index (including primary key) on a BINARY field without length.

So, the schema definition should be something like this (please double check if you're not using MySQL):

There are two additional notes for this particular trait.

Note 1. In order to get a string representation of your uuid, simple call $model->id_string and you'll get it.

Note 2. You can use User::find($uuid) with both the binary version or the string (bin2hex) version.

Using the optimized uuid

To use the optimized uuid, put the following line in your models: private static $uuidOptimization = true;

In your models

In order to use this in your models, just put use Uuid[32|Binary]ModelTrait;:

Running tests

To run the tests, just run composer install and ./vendor/bin/phpunit.


All versions of eloquent-uuid with dependencies

PHP Build Version
Package Version
Requires webpatser/laravel-uuid Version 2.*
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 alsofronie/eloquent-uuid contains the following files

Loading the files please wait ....