Modules\Core\Source\MicroModules\SystemOptionsModule::installModule PHP Метод

installModule() публичный Метод

public installModule ( )
    public function installModule()
    {
        parent::installModule();
        $this->container->get('db')->schema()->create('options_group', function ($table) {
            $table->increments('id');
            $table->string('name');
            $table->text('description');
            $table->char('active', 1)->default(1);
            $table->timestamps();
        });
        $this->container->get('db')->schema()->create('options', function ($table) {
            $table->increments('id');
            $table->integer('options_group_id')->unsigned();
            $table->string('name', 255);
            $table->text('description');
            $table->string('value')->nullable();
            $table->string('type');
            $table->string('code');
            $table->string('values')->nullable();
            $table->string('frozen')->nullable();
            $table->timestamps();
            $table->unique('code');
            $table->index(['options_group_id', 'code']);
            $table->foreign('options_group_id')->references('id')->on('options_group');
        });
        $this->seed();
    }

Usage Example

Пример #1
0
 public function installModule()
 {
     parent::installModule();
     $installMicroModule = new SystemOptionsModule();
     $installMicroModule->installModule();
     $installMicroModule = new AuthModule();
     $installMicroModule->installModule();
     $installMicroModule = new PublicModule();
     $installMicroModule->installModule();
     $installMicroModule = new CustomizerAdminPanelModule();
     $installMicroModule->installModule();
     $this->saveConfigForModule(self::class, ["params" => ["installed" => true, "active" => true]]);
 }