Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddRendererToCustomFieldsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('custom_fields', function (Blueprint $table) {
$table->text('renderer')->nullable();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('custom_fields', function (Blueprint $table) {
$table->dropColumn('renderer');
});
}
}
2 changes: 1 addition & 1 deletion src/App/Http/Controllers/PlainCustomFieldController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(CustomField $customField)
* @param string|null $type
* @return JsonResponse
*/
public function index(string $type = null): JsonResponse
public function index(?string $type = null): JsonResponse
{
return response()->json($this->customField::plain($type)->get());
}
Expand Down
1 change: 1 addition & 0 deletions src/App/Http/Requests/CustomFieldCreateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function rules()
'validation_id' => 'nullable|exists:custom_field_validations,id',
'group' => 'nullable|string',
'order' => 'nullable|integer',
'renderer' => 'nullable|string',
];
}

Expand Down
1 change: 1 addition & 0 deletions src/App/Http/Requests/CustomFieldUpdateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function rules()
'validation_id' => 'nullable|exists:custom_field_validations,id',
'group' => 'nullable|string',
'order' => 'nullable|integer',
'renderer' => 'nullable|string',
];

return Arr::except($rules, self::LOCKED_FOR_EDITING);
Expand Down
1 change: 1 addition & 0 deletions src/App/Http/Requests/PlainCustomFieldRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function rules()
'validation_id' => 'nullable|exists:custom_field_validations',
'group' => 'nullable|string',
'order' => 'nullable|integer',
'renderer' => 'nullable|string',
];
}

Expand Down
1 change: 1 addition & 0 deletions src/App/Http/Requests/RemoteCustomFieldRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function rules()
'validation_id' => 'nullable|exists:custom_field_validations',
'group' => 'nullable|string',
'order' => 'nullable|integer',
'renderer' => 'nullable|string',
'remote' => 'required|array',
'remote.url' => 'required|url',
'remote.method' => 'required|in:GET,POST,PUT',
Expand Down
1 change: 1 addition & 0 deletions src/App/Http/Requests/SelectionCustomFieldRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function rules()
'validation_id' => 'nullable|exists:custom_field_validations',
'group' => 'nullable|string',
'order' => 'nullable|integer',
'renderer' => 'nullable|string',
'selection' => 'array',
'selection.multiselect' => 'boolean',
'values' => 'array',
Expand Down
2 changes: 1 addition & 1 deletion src/App/Models/CustomField.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function selectable(): MorphTo
return $this->morphTo();
}

public function scopePlain(Builder $query, string $subType = null): Builder
public function scopePlain(Builder $query, ?string $subType = null): Builder
{
/** @var PlainType $plainType */
$plainType = app(PlainType::class);
Expand Down
Loading