1. Go to this page and download the library: Download georgeff/schema 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/ */
georgeff / schema example snippets
use Georgeff\Schema\Blueprint;
use Georgeff\Schema\Compiler\PostgreSQLCompiler;
$blueprint = new Blueprint('users');
$blueprint->id();
$blueprint->string('email')->unique();
$blueprint->string('name');
$blueprint->timestamps();
$compiler = new PostgreSQLCompiler();
foreach ($compiler->create($blueprint) as $sql) {
// execute $sql against your connection
}
use Georgeff\Schema\Compiler\MySQLCompiler;
use Georgeff\Schema\Compiler\PostgreSQLCompiler;
use Georgeff\Schema\Compiler\SQLiteCompiler;
$compiler = new MySQLCompiler(
engine: 'InnoDB', // default
charset: 'utf8mb4', // default
collate: 'utf8mb4_unicode_ci' // default
);
$compiler = new PostgreSQLCompiler(
schema: 'public' // default; set to your target schema if not using the default
);