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();
 }
 public function installModule()
 {
     parent::installModule();
     $this->container->get('db')->schema()->create('user_views_settings', function ($table) {
         $table->increments('id');
         $table->integer('user_id');
         $table->string('group');
         $table->string('value')->nullable();
         $table->string('option_type')->nullable();
         $table->string('code');
         $table->index(['user_id', 'group', 'code']);
     });
 }
Exemple #3
0
 public function installModule()
 {
     parent::installModule();
     $this->container->get('db')->schema()->create('pages', function ($table) {
         $table->increments('id');
         $table->string('name');
         $table->string('code')->nullable();
         $table->string('sort')->default(100)->nullable();
         $table->string('url_prefix')->nullable();
         $table->text('preview_text')->nullable();
         $table->text('detail_text')->nullable();
         $table->string('preview_picture')->nullable();
         $table->string('detail_picture')->nullable();
         $table->integer('show_in_menu')->default(0)->nullable();
         $table->string('name_for_menu')->nullable();
         $table->integer('active')->default(1);
         $table->timestamps();
     });
     $this->seed();
 }
Exemple #4
0
 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();
 }
Exemple #5
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]]);
 }
Exemple #6
0
 public function installModule()
 {
     parent::installModule();
     $this->container->get('db')->schema()->create('sections', function ($table) {
         $table->increments('id');
         $table->string('name');
         $table->string('code');
         $table->integer('sort')->default(100)->nullable();
         $table->integer('parent_id')->default(0)->nullable();
         $table->text('detail_text')->nullable();
         $table->string('detail_picture')->nullable();
         $table->string('show_in_menu')->nullable();
         $table->string('name_for_menu')->nullable();
         $table->string('path')->nullable();
         $table->char('active', 1)->default(1);
         $table->timestamps();
         $table->index(['code', 'parent_id', 'path']);
         //$table->foreign('parent_id')->references('id')->on('sections');
     });
     $this->container->get('db')->schema()->table('pages', function ($table) {
         $table->integer('category_id')->default(0)->nullable();
         //$table->foreign('category_id')->references('id')->on('sections');
     });
     $path = RESOURCE_PATH . 'models_field_info/pages.json';
     $pagesField = FileWorker::getJsonDataFile($path);
     if (!$pagesField) {
         $pagesField = [];
     }
     $trigUrlPrefix = false;
     foreach ($pagesField as $field) {
         if ($field->name == 'url_prefix') {
             $field->type = "hidden";
             $trigUrlPrefix = true;
             break;
         }
     }
     if (!$trigUrlPrefix) {
         $cId = new \stdClass();
         $cId->name = "url_prefix";
         $cId->type = "hidden";
         $pagesField[] = $cId;
     }
     $cId = new \stdClass();
     $cId->name = "category_id";
     $cId->type = "select";
     $pagesField[] = $cId;
     FileWorker::saveJsonFile($path, $pagesField);
     FileWorker::addItemInModelsFillable('Pages', 'category_id');
     $this->saveConfigForModule(self::class, ["params" => ["installed" => true, "active" => true]]);
 }
Exemple #7
0
 public function installModule()
 {
     parent::installModule();
     $this->saveConfigForModule(self::class, ["params" => ["installed" => true, "active" => true]]);
 }