From a5afab5cea3e3960d687370a8b4d48c889e42812 Mon Sep 17 00:00:00 2001 From: Hendrik Hagendorn Date: Sun, 19 Feb 2023 23:02:18 +0100 Subject: [PATCH] form.group.tax: default to displaying title instead of name --- app/View/Components/Form/Group/Tax.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/View/Components/Form/Group/Tax.php b/app/View/Components/Form/Group/Tax.php index 7308d6252..59104f3c5 100644 --- a/app/View/Components/Form/Group/Tax.php +++ b/app/View/Components/Form/Group/Tax.php @@ -30,10 +30,10 @@ class Tax extends Form $this->field = [ 'key' => 'id', - 'value' => 'name' + 'value' => 'title' ]; - $this->taxes = Model::enabled()->orderBy('name')->pluck('name', 'id'); + $this->taxes = Model::enabled()->orderBy('name')->get()->pluck('title', 'id'); $tax_id = old('tax.id', old('tax_id', null)); @@ -43,7 +43,7 @@ class Tax extends Form if (! $this->taxes->has($tax_id)) { $tax = Model::find($tax_id); - $this->taxes->put($tax->id, $tax->name); + $this->taxes->put($tax->id, $tax->title); } }