Register additional table blueprints for use in database migrations

@return void
480697
private function registerBlueprints()
    {
        Blueprint::macro('active', function ($name = 'active', $default = false) {
            return $this->boolean($name)->default($default);
        });

        Blueprint::macro('featured', function ($name = 'featured', $default = false) {
            return $this->boolean($name)->default($default);
        });

        Blueprint::macro('sortable', function ($name = 'sort_order', $default = false) {
            return $this->integer($name)->default(1);
        });

        Blueprint::macro('meta', function ($name = 'meta_attributes') {
            return $this->json($name)->nullable();
        });

        Blueprint::macro('priority', function ($name = 'priority', $default = 50) {
            return $this->integer($name)->default($default);
        });

        Blueprint::macro('slug', function ($name = 'slug') {
            return $this->string($name)->unique()->index();
        });
    }
119761
public function apply()
    {
        Schema::create(Model::TABLE_NAME, function (Blueprint $table) {
            $table->increments(Model::FIELD_ID);
            $table->string(Model::FIELD_TITLE, Model::LENGTH_TITLE);
            $table->softDeletes();
            $table->timestamps();
        });
    }
1258052
public function generateMigration()
    {
        if (!$this->confirm('Do you want to create a migration?')) {
            return;
        }

        $this->console->call('generate:migration', [
            'name' => "create_{$this->getEntities()}_table",
            '--fields' => $this->console->option('fields'),
            '--force' => $this->console->option('force'),
        ]);
    }
1299746
public function up()
    {
        Schema::create('categories', function (Blueprint $table) {
            $table->increments('id');
            // nested sets fields
            $table->unsignedInteger('parent_id')->nullable()->index();
            $table->unsignedInteger('lft')->nullable()->index();
            $table->unsignedInteger('rgt')->nullable()->index();
            $table->unsignedInteger('depth')->nullable();

            $table->string('title');
            $table->string('alias')->index();
            $table->string('note')->nullable();
            $table->boolean('published')->default(false)->index();
            $table->boolean('authenticated')->default(false)->index();
            $table->integer('hits')->default(0);
            $table->mediumText('description')->nullable();
            $table->text('parameters')->nullable();

            $table->unsignedInteger('created_by')->nullable()->index();
            $table->unsignedInteger('updated_by')->nullable()->index();
            $table->timestamps();
        });
    }
580879
public function up()
    {
        if (! Schema::hasTable($this->table)) {
            Schema::create($this->table, function (Blueprint $table) {
                $table->increments('id');
                $table->string('original_filename')->nullable();
                $table->string('original_filepath')->nullable();
                $table->string('original_filedir')->nullable();
                $table->string('original_extension', 4)->nullable();
                $table->string('original_mime', 10)->nullable();
                $table->integer('original_filesize')->unsigned()->nullable();
                $table->smallInteger('original_width')->unsigned()->nullable();
                $table->smallInteger('original_height')->unsigned()->nullable();
                $table->string('path')->nullable();
                $table->string('dir')->nullable();
                $table->string('filename')->nullable();
                $table->string('basename')->nullable();
                $table->text('exif')->nullable();

                foreach (Config::get('imageupload.dimensions') as $key => $dimension) {
                    $table->string($key.'_path')->nullable();
                    $table->string($key.'_dir')->nullable();
                    $table->string($key.'_filename')->nullable();
                    $table->string($key.'_filepath')->nullable();
                    $table->string($key.'_filedir')->nullable();
                    $table->integer($key.'_filesize')->unsigned()->nullable();
                    $table->smallInteger($key.'_width')->unsigned()->nullable();
                    $table->smallInteger($key.'_height')->unsigned()->nullable();
                    $table->boolean($key.'_is_squared')->unsigned()->nullable();
                }

                $table->timestamps();
            });
        }
    }
483774
protected function registerMigrationGenerator()
	{
		$this->app['generate.migration'] = $this->app->share(function($app)
		{
			$cache = new Cache($app['files']);
			$generator = new Generators\MigrationGenerator($app['files'], $cache);

			return new Commands\MigrationGeneratorCommand($generator);
		});
	}
1353195
protected function registerPublishes(): void
    {
        if ($this->app->runningInConsole()) {
            $migrationsPath = __DIR__ . '/../../database/migrations';

            $this->publishes([
                $migrationsPath => database_path('migrations'),
            ], 'migrations');

            $this->loadMigrationsFrom($migrationsPath);
        }
    }
804154
protected function registerCmsMigrator()
    {
        // Make sure that we do not use the same migrations table if CMS migrations
        // share the database with the app.
        $this->app->singleton('cms.migration-repository', function (Application $app) {

            $table = $this->getCore()->config(
                'database.migrations.table',
                $app['config']['database.migrations']
            );

            return new DatabaseMigrationRepository($app['db'], $table);
        });

        // This CMS migrator uses the exact same binding setup as the normal migrator,
        // except for this table configuration.
        $this->app->singleton('cms.migrator', function ($app) {
            return new Migrator($app['cms.migration-repository'], $app['db'], $app['files']);
        });


        // Bind the migrator contextually, so it will be set for the commands bound here.
        $this->app->when(MigrateCommand::class)
                  ->needs(Migrator::class)
                  ->give('cms.migrator');

        $this->app->when(MigrateInstallCommand::class)
                  ->needs(MigrationRepositoryInterface::class)
                  ->give('cms.migration-repository');

        $this->app->when(MigrateRefreshCommand::class)
                  ->needs(Migrator::class)
                  ->give('cms.migrator');

        $this->app->when(MigrateResetCommand::class)
                  ->needs(Migrator::class)
                  ->give('cms.migrator');

        $this->app->when(MigrateRollbackCommand::class)
                  ->needs(Migrator::class)
                  ->give('cms.migrator');

        $this->app->when(MigrateStatusCommand::class)
                  ->needs(Migrator::class)
                  ->give('cms.migrator');

        return $this;
    }
978846
public function up()
    {
        Schema::create($this->table, function (Blueprint $table) {
            $table->increments('id');
            $table->string($this->key)->index();
            $table->text($this->value);
        });
    }
208790
public function up()
    {
        Schema::create('pages', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('sequence')->unsigned()->nullable()->default(0)->index('page_sequence');
            $table->boolean('visible')->nullable()->default(0);
            $table->integer('visible_from')->unsigned()->nullable();
            $table->integer('visible_to')->unsigned()->default(0);
            $table->string('internal_name', 64)->nullable()->unique('pages_internal_name');
            $table->boolean('external_indexing')->default(1)->index('pages_external_indexing');
            $table->boolean('internal_indexing')->default(1)->index('pages_internal_indexing');
            $table->boolean('visible_in_nav')->default(1);
            $table->boolean('visible_in_nav_cms')->default(1);
            $table->boolean('children_visible_in_nav')->default(1);
            $table->boolean('children_visible_in_nav_cms')->default(1);
            $table->boolean('children_template_id')->nullable();
            $table->string('children_url_prefix', 2048)->charset('utf8')->nullable();
            $table->boolean('children_ordering_policy')->nullable();
            $table->boolean('grandchild_template_id')->nullable();
            $table->string('keywords')->nullable();
            $table->text('description', 65535)->nullable();
            $table->integer('created_by')->unsigned()->nullable();
            $table->integer('created_time')->unsigned()->nullable();
            $table->string('primary_uri', 2048)->nullable();
            $table->integer('feature_image_id')->unsigned()->nullable()->index('pages_feature_image_id');
            $table->index(['visible', 'visible_from', 'visible_to', 'visible_in_nav'], 'pages_sitelist');
            $table->index(['visible_in_nav_cms', 'visible_from'], 'pages_cmslist');
            $table->integer('parent_id')->unsigned()->nullable();
            $table->foreign('parent_id')->references('id')->on('pages')->onUpdate('CASCADE')->onDelete('CASCADE');
            $table->boolean('disable_delete')->default(false);

            $table->softDeletes();
            $table->integer('deleted_by')->unsigned()->nullable();
            $table->tinyinteger(Page::ATTR_ADD_BEHAVIOUR)->default(1);
            $table->tinyinteger(Page::ATTR_CHILD_ADD_BEHAVIOUR)->default(1);
            $table->index(['deleted_at', 'parent_id', 'visible']);
            $table->boolean(Page::ATTR_ENABLE_ACL)->default(false);
        });

        DB::statement('ALTER TABLE pages ADD FULLTEXT pages_primary_uri(primary_uri)');
    }
271364
public function up()
    {

        Schema::create('User', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username', 25)->nullable()->unique();
            $table->string('password', 60)->nullable();
            $table->string('first_name', 25);
            $table->string('last_name', 25);
            $table->string('email')->unique();
            $table->text('description')->nullable();
            $table->timestamp('birthday')->nullable();
            $table->string('pic')->nullable();
            $table->integer('gender');
            $table->tinyInteger('status');
            $table->string('ip', 15);
            $table->tinyInteger('staff');
            $table->tinyInteger('force_new_password');
            $table->timestamp('last_login')->nullable();
            $table->text('permissions')->nullable();
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
            $table->creation();
        });

        Schema::table('User', function (Blueprint $table) {
            $table->creationRelation();
        });

        Schema::create('Visits', function (Blueprint $table) {
            $table->increments('id');
            $table->string('url')->nullable();
            $table->string('ip', 15)->nullable();
            $table->string('browser')->nullable();
            $table->tinyInteger('checked');

            $table->string('isoCode')->nullable();
            $table->string('country')->nullable();
            $table->string('city')->nullable();
            $table->string('state')->nullable();
            $table->string('postal_code')->nullable();
            $table->string('lat')->nullable();
            $table->string('lon')->nullable();
            $table->string('timezone')->nullable();
            $table->string('continent')->nullable();
            $table->timestamps();
        });

        Schema::create('Logs', function (Blueprint $table) {
            $table->increments('id');
            $table->text('log');
            $table->integer('target')->nullable();
            $table->string('ip', 15)->nullable();
            $table->timestamps();
            $table->creation();
        });

        Schema::table('Logs', function (Blueprint $table) {
            $table->creationRelation();
        });

        Schema::create('Settings', function (Blueprint $table) {
            $table->increments('id');
            $table->string('friendly_name', 25);
            $table->string('name', 25);
            $table->string('value', 150)->nullable();
            $table->string('description', 250)->nullable();
            $table->timestamps();
            $table->creation();
        });

        Schema::table('Settings', function (Blueprint $table) {
            $table->creationRelation();
        });

        Schema::create('Group', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 25);
            $table->string('description', 250)->nullable();
            $table->string('slug', 250);
            $table->text('permissions')->nullable();

            $table->timestamps();
            $table->softDeletes();
            $table->creation();

            $table->unique('slug');
        });

        Schema::table('Group', function (Blueprint $table) {
            $table->creationRelation();
        });

        Schema::create('Group_User', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user')->unsigned();
            $table->integer('group')->unsigned();

            $table->timestamps();
            $table->softDeletes();
            $table->creation();

            $table->foreign('user')->references('id')->on('User');
            $table->foreign('group')->references('id')->on('Group');
        });

        Schema::table('Group_User', function (Blueprint $table) {
            $table->creationRelation();
        });

        Schema::create('ActivityFeed', function (Blueprint $table) {
            $table->increments('id');
            $table->string('added_by', 150);
            $table->text('activity');
            $table->string('icon', 100);
            $table->string('link', 250)->nullable();
            $table->text('permissions')->nullable();

            $table->timestamps();
        });

    }
330502
protected function addForeignKeys(Blueprint $blueprint)
    {
        $sql = '';

        $foreigns = $this->getCommandsByName($blueprint, 'foreign');

        // Once we have all the foreign key commands for the table creation statement
        // we'll loop through each of them and add them to the create table SQL we
        // are building, since SQLite needs foreign keys on the tables creation.
        foreach ($foreigns as $foreign) {
            $sql .= $this->getForeignKey($foreign);

            if (! is_null($foreign->onDelete)) {
                $sql .= " on delete {$foreign->onDelete}";
            }

            if (! is_null($foreign->onUpdate)) {
                $sql .= " on update {$foreign->onUpdate}";
            }
        }

        return $sql;
    }
1288956
public function up()
    {
        // Create table for storing roles
        Schema::create('data_types', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->unique();
            $table->string('slug')->unique();
            $table->string('display_name_singular');
            $table->string('display_name_plural');
            $table->string('icon')->nullable();
            $table->string('model_name')->nullable();
            $table->string('description')->nullable();
            $table->boolean('generate_permissions')->default(false);
            $table->timestamps();
        });

        // Create table for storing roles
        Schema::create('data_rows', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('data_type_id')->unsigned();
            $table->string('field');
            $table->string('type');
            $table->string('display_name')->nullable();
            $table->boolean('required')->default(false);
            $table->boolean('browse')->default(true);
            $table->boolean('read')->default(true);
            $table->boolean('edit')->default(true);
            $table->boolean('add')->default(true);
            $table->boolean('delete')->default(true);
            $table->text('details')->nullable();

            $table->foreign('data_type_id')->references('id')->on('data_types')
                ->onUpdate('cascade')->onDelete('cascade');
        });
    }
847470
public function up()
    {
        $this->createSchema(function(Blueprint $table) {
            $table->increments('id');
            $table->string('key')->index();
            $table->text('value');
        });
    }
1108754
public function up()
    {
        Schema::create('scaffoldinterfaces', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->String('package');
            $table->String('migration');
            $table->String('model');
            $table->String('controller');
            $table->String('views');
            $table->String('tablename');
            $table->timestamps();
        });
        Schema::create('relations', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->integer('scaffoldinterface_id')->unsigned();
            $table->String('to');
            $table->String('having');
            $table->foreign('scaffoldinterface_id')->references('id')->on('scaffoldinterfaces')->onDelete('cascade');
            $table->timestamps();
        });
    }
291625
protected function registerDatabaseService(): void
    {
        $this->app->alias('db', \Illuminate\Database\ConnectionResolverInterface::class);
        $this->app->register(\Illuminate\Database\DatabaseServiceProvider::class);

        if (File::exists($this->app->databasePath('seeds'))) {
            collect(File::files($this->app->databasePath('seeds')))->each(
                function ($file) {
                    File::requireOnce($file);
                }
            );
        }
    }
299005
protected function registerMigration()
    {
        $this->app->singleton('orchestra.publisher.migrate', function (Application $app) {
            // In order to use migration, we need to boot 'migration.repository'
            // instance.
            $app->make('migration.repository');

            return new MigrateManager($app, $app->make('migrator'));
        });
    }