Download the PHP package emadadly/laravel-uuid without Composer

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

Laravel Uuid

Latest Version on Packagist Quality Score Total Downloads

A simple, automatic UUID generator for any model based on Laravel 5.5 and above, By using this package when each new entry you will get the following :

What is a UUID?

A universally unique identifier (UUID) is a 128-bit number used to identify information in computer systems. is a 36 character long identifier made up of 32 alphanumeric characters with four hyphens in amongst it. For example:123E4567-E89b-12D3-A456-426655440000 containing letters and numbers. that will uniquely identify something. you can read more here

What are the benefits?

  1. With distributed systems you can be pretty confident that the primary key’s will never collide.

  2. When building a large scale application when an auto increment primary key is not ideal.

  3. It makes replication trivial (as opposed to int’s, which makes it REALLY hard)

  4. Safe enough doesn’t show the user that you are getting information by id, for example https://example.com/user/25/settings

Installation

To get started, require this package

Add the following to the require section of your projects composer.json file.

Run composer update to download the package

Finally, you'll also need to add the ServiceProvider

Laravel 5.5 and above

Uses package auto discovery feature, no need to edit the config/app.php file.

Laravel 5.4 and below

You need to add the ServiceProvider in config/app.php with the following

You could also publish the config file:

and set your default_uuid_column setting, if you have an app-wide default.

Our package assumes the column is uuid by default. If you want to replace the default id follow these steps.

Usage

Migrations

When using the migration you should add uuid as column type, and set the name it the same name in the config/uuid.php file.

it's will create column uuid name and a char(36) inside of our database schema, To be ready to receive Uuids.

Simply, the schema seems something like this.

Models

Use this trait in any model.

To set up a model to using Uuid, simply use the Uuids trait:

Controller

When you create a new instance of a model which uses Uuids, our package will automatically add Uuid.

Also when use show, update or delete method inside the Controller, it very easy to implement through ExampleModel::uuid() scope method

Replacing default ID with UUID

If you want to replace the default id column with the uuid be sure to set 'default_uuid_column' => 'uuid', to 'default_uuid_column' => 'id', in the config\uuid.php file.

On your migration(s), change the id column type from increments to uuid as well as manually adding the primary key. Note: This also applies to model relationship columns, if the related model is using an UUID, the column type should reflect that

Then on the model(s) you will need to set the incrementing flag to false.

Support

If you are having general issues with this package, feel free to contact me on Twitter.

If you believe you have found an issue, please report it using the GitHub issue tracker, or better yet, fork the repository and submit a pull request.

If you're using this package, I'd love to hear your thoughts. Thanks!

License

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


All versions of laravel-uuid with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0|^8.0|^8.1
illuminate/support Version 6.*|7.*|8.*|9.*|^10.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 emadadly/laravel-uuid contains the following files

Loading the files please wait ....