sudiptpa/guid

A Simple GUID generator Package for PHP.

v1.0.5 2020-08-08 10:41 UTC

This package is auto-updated.

Last update: 2024-11-19 03:06:33 UTC


README

This package is useful for creating globally unique identifiers (GUID). It's under MIT license so it's free for everyone.

StyleCI Latest Stable Version Total Downloads License

Installation

You can install the package via composer: Composer.

composer require sudiptpa/guid

If you want to use this package with Laravel v4.2 stick with the backward version v0.0.1 in your composer.josn file.

"sudiptpa/guid": "v0.0.1"

Usage

Laravel

To consume the this package from Laravel application, register the package service provider within your config/app.php file.

'providers' => [
    Sujip\Guid\GuidServiceProvider::class,
]

'aliases' => [
   'Guid' => Sujip\Guid\Guid::class,
]

If you are a Laravel v5.5 user, this package has been configured for discovery, Laravel will automatically register its service providers and facades when it is installed, creating a convenient installation experience for you.

Create GUID

echo "GUID: " . Guid::create(); //example output : 2b23924f-0eaa-4133-848e-7ce1edeca8c9

echo "GUID: " . guid(); // example output: 2b23924f-0eaa-4133-848e-7ce1edeca8c9

Outside Laravel

require __DIR__ . '/vendor/autoload.php';

$guid = new \Sujip\Guid\Guid;

echo $guid->create();

Output

//Example: 2b23924f-0eaa-4133-848e-7ce1edeca8c9

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Contributions are welcome and will be fully credited.

Contributions can be made via a Pull Request on Github.

Support

If you are having general issues with the package, feel free to drop me and email sudiptpa@gmail.com

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

License

The GUID package is open-sourced software licensed under the MIT license.