Skip to content

Commit

Permalink
additional field input updated
Browse files Browse the repository at this point in the history
  • Loading branch information
AravindRam-Ranium committed Feb 26, 2024
1 parent 7a63b91 commit 0576ecd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions database/migrations/create_user_consent_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ return new class extends Migration
$table->string('label')->nullable()->default(null);
$table->text('text')->nullable()->default(null);
$table->boolean('additional_info')->default(0);
$table->string('additional_info_title')->nullable();
$table->json('fields')->nullable();
$table->boolean('is_mandatory')->default(0);
$table->boolean('is_current')->default(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@if ($getRecord()->additional_info && ($fields = $getRecord()->fields))
<x-filament::section>
<x-slot name="heading">
Additional Info
{{$getRecord()->additional_info_title}}
</x-slot>
<div class="grid grid-cols-3 gap-4">
@foreach ($fields as $key => $field)
Expand Down Expand Up @@ -103,4 +103,4 @@ class="bg-gray-200 appearance-none rounded w-full py-2 px-4 text-gray-700 leadin
</div>
</x-filament::section>
@endif
</x-dynamic-component>
</x-dynamic-component>
1 change: 1 addition & 0 deletions src/Models/ConsentOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class ConsentOption extends Model
'force_user_update',
'is_current',
'additional_info',
'additional_info_title',
'enabled',
'sort_order',
'models',
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/ConsentOptionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public static function form(Form $form): Form
->columnSpanFull(),
])->columns(3),
Section::make('Additional Info')->schema([
Forms\Components\TextInput::make('additional_info_title')
->required(),
Repeater::make('fields')->label('')
->schema([
Forms\Components\TextInput::make('name')
Expand Down

0 comments on commit 0576ecd

Please sign in to comment.