PHP code example of noud / laravel-schema-real-binary
1. Go to this page and download the library: Download noud/laravel-schema-real-binary 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/ */
noud / laravel-schema-real-binary example snippets
Schema::create('currency', function (Blueprint $table) {
$table->realBinary('code', 3)->unique();
// works as well
// $table->char('code', 3)->charset('binary')->unique();
// more fields
});
Schema::create('country', function (Blueprint $table) {
$table->string('id')->unique();
$table->realBinary('currency', 3);
// works as well
// $table->char('currency', 3)->charset('binary');
$table->foreign('currency')->references('code')->on('currency');
});