1. Go to this page and download the library: Download rawaby88/muid 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/ */
rawaby88 / muid example snippets
namespace App\Models;
use Rawaby88\Muid\Database\Eloquent\Model;
class Organization extends Model
{
/**
* The "prefix" of the MUID.
*
* @var string
*/
protected $keyPrefix = 'org_';
}
namespace App\Models;
use \Rawaby88\Muid\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
/**
* The "prefix" of the MUID.
*
* @var string
*/
protected $keyPrefix = 'user_';
}
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Rawaby88\Muid\Database\Eloquent\Muid;
class Organization extends Model
{
use Muid;
/**
* The "prefix" of the MUID.
*
* @var string
*/
protected $keyPrefix = 'organization_';
}
/**
* The "prefix" of the MUID.
*
* @var string
*/
protected $keyPrefix = 'example_';
/*
|--------------------------------------------------------------------------
| Muid length
|--------------------------------------------------------------------------
|
| Here you can change the MUID length.
| remember that length |--------------------------------------------------------------------------
|
| Recommended not to change
|
*/
'alfa_small' => 'abcdefghilkmnopqrstuvwxyz',
'alfa_capital' => 'ABCDEFGHILKMNOPQRSTUVWXYZ',
'digits' => '0123456789',
/*
|--------------------------------------------------------------------------
| Capital Char options
|--------------------------------------------------------------------------
|
| Set it to FALSE if you wish not to use capital letters in the generated MUID
|
*/
'allow_capital' => TRUE,