Skip to content

Instantly share code, notes, and snippets.

@Netrilix
Last active July 21, 2016 03:58
Show Gist options
  • Save Netrilix/30ea24925ce3be650ef856d2c79c8bb8 to your computer and use it in GitHub Desktop.
Save Netrilix/30ea24925ce3be650ef856d2c79c8bb8 to your computer and use it in GitHub Desktop.
$connection = Capsule::connection();
$schema = Capsule::schema();
$schema->create(static::getSchemaTable('configuration')->name, function(Blueprint $table)
{
$table->engine = 'InnoDB';
$table->collation = 'utf8_unicode_ci';
$table->charset = 'utf8';
$table->increments('id')->nullable(false);
$table->string('plugin', 50)->nullable(false)->comment('The name of the plugin that manages this setting (set to \'userfrosting\' for core settings)');
$table->string('name', 150)->nullable(false)->comment('The name of the setting.');
$table->longText('value')->nullable(false)->comment('The current value of the setting.');
$table->text('description')->nullable(false)->comment('A brief description of this setting.');
});
$schema->create(static::getSchemaTable('authorize_group')->name, function(Blueprint $table) {
$table->engine = 'InnoDB';
$table->collation = 'utf8_unicode_ci';
$table->charset = 'utf8';
$table->increments('id');
$table->integer('group_id')->unsigned();
$table->string('hook', 200)->nullable(false)->comment('A code that references a specific action or URI that the group has access to.');
$table->text('conditions')->nullable(false)->comment('The conditions under which members of this group have access to this hook.');
});
$schema->create(static::getSchemaTable('authorize_user')->name, function(Blueprint $table) {
$table->engine = 'InnoDB';
$table->collation = 'utf8_unicode_ci';
$table->charset = 'utf8';
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('hook', 200)->nullable(false)->comment('A code that references a specific action or URI that the user has access to.');
$table->text('conditions')->nullable(false)->comment('The conditions under which the user has access to this action.');
});
$schema->create(static::getSchemaTable('group')->name, function(Blueprint $table) {
$table->engine = 'InnoDB';
$table->collation = 'utf8_unicode_ci';
$table->charset = 'utf8';
$table->increments('id');
$table->string('name', 150)->nullable(false);
$table->boolean('is_default')->nullable(false)->default(0)->comment('Specifies whether this permission is a default setting for new accounts.');
$table->boolean('can_delete')->nullable(false)->default(0)->comment('Specifies whether this permission can be deleted from the control panel.');
$table->string('theme', 100)->nullable(false)->default('default')->comment('The theme assigned to primary users in this group.');
$table->string('landing_page', 200)->nullable(false)->default('dashboard')->comment('The page to take primary members to when they first log in.');
$table->string('new_user_title', 200)->nullable(false)->default('New User')->comment('The default title to assign to new primary users.');
$table->string('icon', 100)->nullable(false)->default('fa fa-user')->comment('The icon representing primary users in this group.');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment