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

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

public installModule ( )
    public function installModule()
    {
        parent::installModule();
        $this->container->get('db')->schema()->create('groups', function ($table) {
            $table->increments('id');
            $table->string('name');
            $table->text('description')->nullable();
            $table->char('active', 1)->default(1);
            $table->timestamps();
        });
        $this->container->get('db')->schema()->create('users', function ($table) {
            $table->increments('id');
            $table->string('email', 120)->unique();
            $table->string('login', 70)->unique();
            $table->string('password', 80);
            $table->char('active', 1)->default(1);
            $table->integer('group_id')->default(3)->unsigned();
            $table->timestamps();
            $table->index(['email', 'login']);
            $table->foreign('group_id')->references('id')->on('groups');
        });
        $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]]);
 }