nathanmac / laravel-guid
Simple GUID generator Package for Laravel 4
Installs: 5 512
Dependents: 0
Suggesters: 0
Security: 0
Stars: 10
Watchers: 3
Forks: 2
Open Issues: 2
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-12-17 04:34:38 UTC
README
Simple GUID generator Package for Laravel 4
Installation
Begin by installing this package through Composer. Edit your project's composer.json
file to require Nathanmac/laravel-guid
.
"require": {
"nathanmac/laravel-guid": "dev-master"
}
Next, update Composer from the Terminal:
composer update
Once this operation completes, the final step is to add the service provider. Open app/config/app.php
, and add a new item to the providers array.
'Nathanmac\GUID\GUIDServiceProvider'
Generate GUID
echo "GUID: " . GUID::generate(); // GUID: 582B5733-8AE1-79D2-DB8F-5720ECBE4306
Generate GUID with a salt value
echo "GUID: " . GUID::generate('custom salt value'); // GUID: 582B5733-8AE1-79D2-DB8F-5720ECBE4306
Generate GUID with braces
echo "GUID: " . GUID::generate(false, true); // GUID: {582B5733-8AE1-79D2-DB8F-5720ECBE4306}