Skip to content

Commit 91897d9

Browse files
Update README.md
1 parent 28813f2 commit 91897d9

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Create new config parameter:
4343
``` php
4444
$factory = new ConfigFactory();
4545
$configItem = $factory->setName('key')
46-
->setType('boolean')
46+
->setType(ConfigDataType::BOOLEAN)
4747
->setValue('1')
4848
->setTags(['system'])//optional
4949
->setDescription('Lorem ipsum dolor sit amet')
@@ -87,7 +87,7 @@ Update config with new values:
8787
``` php
8888
$factory = new ConfigFactory($configId);
8989
$configItem = $factory->setName('updated-key')
90-
->setType('boolean')
90+
->setType(ConfigDataType::BOOLEAN)
9191
->setValue('0')
9292
->setTags(['system'])//optional
9393
->setDescription('updated description')
@@ -145,7 +145,7 @@ You can also use helper functions:
145145
// Creating config item
146146
$factory = new ConfigFactory();
147147
$configItem = $factory->setName('key')
148-
->setType('boolean')
148+
->setType(ConfigDataType::BOOLEAN)
149149
->setValue('1')
150150
->setTags(['system'])//optional
151151
->setDescription('Lorem ipsum dolor sit amet')
@@ -165,7 +165,7 @@ set_config_value('key', 'value');
165165
// Updating config item
166166
$factory = new ConfigFactory($configId);
167167
$configItem = $factory->setName('updated-key')
168-
->setType('boolean')
168+
->setType(ConfigDataType::BOOLEAN)
169169
->setTags(['system'])//optional
170170
->setValue('0')
171171
->setDescription('updated description')

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"require": {
3434
"php": "^8.1|^8.2",
3535
"ext-json": "*",
36-
"doctrine/dbal": "^3.8",
3736
"illuminate/support": "^8.49|^9.0|^10.0",
3837
"laravel/legacy-factories": "^1.0"
3938
},

database/migrations/2021_07_08_091648_create_config_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function up(): void
1717
Schema::create($tableName, function (Blueprint $table) {
1818
$table->bigIncrements('id');
1919
$table->string('name')->unique();
20-
$table->string('type')->default('boolean');
20+
$table->enum('type', ['boolean', 'text'])->default('boolean');
2121
$table->string('val')->nullable();
2222
$table->text('description')->nullable();
2323
$table->timestamps();

0 commit comments

Comments
 (0)