Attempt to work with select menu's in admin views.

This commit is contained in:
purple 2023-04-08 21:31:20 +02:00
parent 9eded0df5d
commit 3e7d4b0e3f
3 changed files with 11 additions and 6 deletions

View file

@ -13,15 +13,15 @@ class BlueprintSettingsFormRequest extends AdminFormRequest
{
return [
'placeholder' => 'string',
'developer' => 'boolean',
'developer' => 'string',
];
}
public function attributes(): array
{
return [
'placeholder' => 'placeholder',
'developer' => 'developer',
'placeholder' => 'Placeholder',
'developer' => 'Developer Mode',
];
}
}

View file

@ -13,13 +13,15 @@ class CreateBlueprintTable extends Migration
*/
public function up()
{
Schema::dropIfExists('blueprint');
Schema::create('blueprint', function (Blueprint $table) {
$table->id();
$table->string('placeholder')->nullable(); // Used for work-in-progress options.
$table->boolean('developer')->nullable();
$table->string('developer')->nullable(); // Somehow I can't make it work with a boolean.
$table->timestamp('timestamp')->useCurrent()->onUpdate(null);
});
Schema::dropIfExists('bpkey');
Schema::create('bpkey', function (Blueprint $table) {$table->id();$table->string('k')->nullable();$table->boolean('v')->nullable();$table->timestamp('timestamp')->useCurrent()->onUpdate(null);});
}

View file

@ -62,8 +62,11 @@
</div>
<div class="col-xs-4">
<label class="control-label">Developer Mode</label>
<input type="text" required name="developer" id="placeholder" value="{{ $bp->dbGet('developer') }}" class="form-control" @if(!$bp->c())readonly @endif/>
<p class="text-muted small">Can be true or false.</p>
<select class="form-control" name="developer">
<option value="false">Disabled</option>
<option value="true" @if($bp->dbGet('developer')) @endif>Enabled</option>
</select>
<p class="text-muted small">Enable or disable developer-oriented features.</p>
</div>
</div>
</div>