Download the PHP package touhidurabir/laravel-model-uuid without Composer

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

Laravel Model UUID

A simple package to generate model uuid for laravel models

Installation

Require the package using composer:

To publish the config file:

Usage

Use the trait HasUuid in model where uuid needed to attach

By default this package use the column name uuid as for the uuid attach and preform it on model creating event . But these configurations can be changed form the model-uuid.php config file.

Also possible to override the uuid column and attaching event from each of the model . to do that need to place the following method in the model :

Make sure to the put the uuid colun name in migration file

Or can be used with the combination of model-uuid config as such:

This package also include some helper method that make it easy to find model records via UUID. for example

Or simple and direct find

The package also provide a bit of safe guard by checking if the model table has the given uuid column .

If the uuid column not found for model table schema, it will not create and attach an uuid.

It is also possible to disable the uuid generation for certiain purpose temporarily using the provided static method. Then can be enabled again.

Command

This packaga includes a command that can use to set up the model uuid for the missing ones or update existing one . It will be helpful if this package included later in any laravel app that already have some data in it's tables and needed to set up uuid for those records. To utlize this command run

The one argument it reuired is the name of the models command seperated(if there is multiple models to run for) . Behind the scene it calls a queue job to go through the model recored and work on those to update/fill uuid column value. Other options as follow

--path=

By default it assumes all the models are located in the App\Models\ namespace . But if it's located some where else , use the option to define the proper model space path with trailing slash .

--update-all

By default this command will only work with those model records that have the defined uuid column null . So basically it will fill up the missing ones , but if this false is provided with the command it will update all regardless of uuid associated with or not.

--on-job

This defined if this will update/fill missing one through a queue job . The command use a job where the main logic resides in . But by default it uses the framework provided dispatchNow method to run the jon in sync way . if the falg provided and queue configured properly, it will push the job in the queue .

--job=

If need to pass custom queue job implementation, it can be directly provided though this option . also one can update the queue class in the config file .

The default job is defined in the configuration model-uuid file as the key regeneration_job.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT


All versions of laravel-model-uuid with dependencies

PHP Build Version
Package Version
Requires ramsey/uuid Version ^4.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 touhidurabir/laravel-model-uuid contains the following files

Loading the files please wait ....