Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0a9d5c7
Next (WIP)
ManukMinasyan Jan 13, 2025
e4ecebb
Organize component for easy management
ManukMinasyan Jan 13, 2025
145156f
Width selector
ManukMinasyan Jan 13, 2025
ae52657
Refactoring, drag & drop
ManukMinasyan Jan 15, 2025
d52a49d
Refactoring, drag & drop
ManukMinasyan Jan 15, 2025
268a78d
Grid system
ManukMinasyan Jan 16, 2025
8464525
Fix Livewire sorting issue
ManukMinasyan Jan 17, 2025
6c1fdd3
Added custom_field_section_id and width to custom_fields table
ManukMinasyan Jan 19, 2025
0174a82
Added model and record for section
ManukMinasyan Jan 19, 2025
65c1cd0
Organize field, added 3 types of sections - section, fieldset and hea…
ManukMinasyan Jan 19, 2025
6296880
Custom FIeld creation & deescription
ManukMinasyan Jan 19, 2025
0ebd956
UpgradeCustomFieldsToV2Command
ManukMinasyan Jan 19, 2025
7ff270c
Fix default section creation
ManukMinasyan Jan 19, 2025
f71356d
Reuse form schemas
ManukMinasyan Jan 19, 2025
1cb57d3
Label translations (WIP)
ManukMinasyan Jan 19, 2025
5e6ec75
Validation - translations
ManukMinasyan Jan 20, 2025
0dd6433
Translate labels, validation rules and descriptions
ManukMinasyan Jan 22, 2025
5934132
Translations
ManukMinasyan Jan 22, 2025
a160288
Removed soft deletes & improved the actions with deactivated section …
ManukMinasyan Jan 23, 2025
59c60fa
Register tenant relationship for CustomFieldSection model
ManukMinasyan Jan 23, 2025
dd934ae
Field migrator rewrite to using activate and deactivate methods, & se…
ManukMinasyan Jan 25, 2025
e9eb104
Rename upgrade command and update its description for clarity
ManukMinasyan Jan 31, 2025
0857294
Enhance upgrade command output and update database schema by adding n…
ManukMinasyan Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/custom-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
|
*/
'table_names' => [
'custom_field_sections' => 'custom_field_sections',
'custom_fields' => 'custom_fields',
'custom_field_values' => 'custom_field_values',
'custom_field_options' => 'custom_field_options',
Expand Down
37 changes: 33 additions & 4 deletions database/migrations/create_custom_fields_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,35 @@
{
public function up(): void
{
/**
* Custom Field Sections
*/
Schema::create(config('custom-fields.table_names.custom_field_sections'), function (Blueprint $table): void {
$uniqueColumns = ['entity_type', 'code'];

$table->id();

if (Utils::isTenantEnabled()) {
$table->foreignId(config('custom-fields.column_names.tenant_foreign_key'))->nullable()->index();
$uniqueColumns[] = config('custom-fields.column_names.tenant_foreign_key');
}

$table->string('code');
$table->string('name');
$table->string('type');
$table->string('entity_type');
$table->unsignedBigInteger('sort_order')->nullable();

$table->string('description')->nullable();

$table->boolean('active')->default(true);
$table->boolean('system_defined')->default(false);

$table->unique($uniqueColumns);

$table->timestamps();
});

/**
* Custom Fields
*/
Expand All @@ -20,6 +49,9 @@ public function up(): void

$table->id();

$table->unsignedBigInteger('custom_field_section_id')->nullable();
$table->string('width')->nullable();

if (Utils::isTenantEnabled()) {
$table->foreignId(config('custom-fields.column_names.tenant_foreign_key'))->nullable()->index();
$uniqueColumns[] = config('custom-fields.column_names.tenant_foreign_key');
Expand All @@ -39,7 +71,6 @@ public function up(): void

$table->unique($uniqueColumns);

$table->softDeletes();
$table->timestamps();
});

Expand All @@ -63,7 +94,6 @@ public function up(): void
$table->string('name')->nullable();
$table->unsignedBigInteger('sort_order')->nullable();

$table->softDeletes();
$table->timestamps();

$table->unique($uniqueColumns);
Expand Down Expand Up @@ -96,14 +126,13 @@ public function up(): void
$table->dateTime('datetime_value')->nullable();
$table->json('json_value')->nullable();

$table->softDeletes();

$table->unique($uniqueColumns, 'custom_field_values_entity_type_unique');
});
}

public function down(): void
{
Schema::dropIfExists(config('custom-fields.table_names.custom_field_sections'));
Schema::dropIfExists(config('custom-fields.table_names.custom_fields'));
Schema::dropIfExists(config('custom-fields.table_names.custom_field_options'));
Schema::dropIfExists(config('custom-fields.table_names.custom_field_values'));
Expand Down
Loading