PHP code example of juggl / unique-hashids
1. Go to this page and download the library: Download juggl/unique-hashids library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
juggl / unique-hashids example snippets
namespace App;
use Juggl\UniqueHashids\GeneratesUnique;
use Illuminate\Database\Eloquent\Model;
class YourModel extends Model
{
use GeneratesUnique;
// The rest of your model
}
namespace App;
use Juggl\UniqueHashids\GeneratesUnique;
use Illuminate\Database\Eloquent\Model;
class YourModel extends Model
{
use GeneratesUnique;
public static $uniqueColumn = 'my_column'; // this will assume 'unique_id' by default.
// The rest of your model
}