PHP code example of eril / schemage
1. Go to this page and download the library: Download eril/schemage 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/ */
eril / schemage example snippets
use Schemage\DSL\Schema;
use Schemage\DSL\Table;
return function (Schema $schema): void {
$schema->table('users', function (Table $t): void {
$t->id();
$t->string('name');
$t->string('email')->unique('users_email_unique');
$t->timestamps();
});
};
$schema->table('roles', function (Table $t) {
...
})->seed([
['id' => 1, 'code' => 'admin'],
['id' => 2, 'code' => 'user'],
]);