diff --git a/app/Http/Controllers/LabelsController.php b/app/Http/Controllers/LabelsController.php index 799d910384..1c5715b35f 100755 --- a/app/Http/Controllers/LabelsController.php +++ b/app/Http/Controllers/LabelsController.php @@ -14,6 +14,7 @@ use App\Models\Setting; use App\Models\Supplier; use App\Models\User; use App\View\Label as LabelView; +use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Storage; class LabelsController extends Controller @@ -21,9 +22,9 @@ class LabelsController extends Controller /** * Returns the Label view with test data * - * @author Grant Le Roux - * @param string $labelName + * @param string $labelName * @return \Illuminate\Contracts\View\View + * @author Grant Le Roux */ public function show(string $labelName) { @@ -66,7 +67,7 @@ class LabelsController extends Controller $exampleAsset->model->category->id = 999999; $exampleAsset->model->category->name = trans('admin/labels/table.example_category'); - $customFieldColumns = CustomField::all()->pluck('db_column'); + $customFieldColumns = CustomField::where('field_encrypted', '=', 0)->pluck('db_column'); collect(explode(';', Setting::getSettings()->label2_fields)) ->filter() diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index dbb6f66222..3c09c900fa 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -804,10 +804,9 @@ class SettingsController extends Controller */ public function getLabels() { - return view('settings.labels', [ - 'setting' => Setting::getSettings(), - 'customFields' => CustomField::all(), - ]); + return view('settings.labels') + ->with('setting', Setting::getSettings()) + ->with('customFields', CustomField::where('field_encrypted', '=', 0)->get()); } /** diff --git a/resources/views/partials/label2-field-definitions.blade.php b/resources/views/partials/label2-field-definitions.blade.php index ad5d1eb2e1..b701ffe69a 100644 --- a/resources/views/partials/label2-field-definitions.blade.php +++ b/resources/views/partials/label2-field-definitions.blade.php @@ -351,6 +351,7 @@ @foreach($customFields as $customField) + @endforeach