Fixed transaction index search and filter, show receipt language text..

This commit is contained in:
Cüneyt Şentürk 2022-06-16 10:45:15 +03:00
parent 3d81941aa1
commit fd76c74472
3 changed files with 9 additions and 5 deletions

View File

@ -3,11 +3,14 @@
namespace App\Traits; namespace App\Traits;
use Throwable; use Throwable;
use Illuminate\Support\Arr;
trait Translations trait Translations
{ {
public function findTranslation($keys, $number = 2) public function findTranslation($keys, $number = 2)
{ {
$keys = Arr::wrap($keys);
try { try {
foreach ($keys as $key) { foreach ($keys as $key) {
if (is_array($key)) { if (is_array($key)) {

View File

@ -4,11 +4,12 @@ namespace App\View\Components;
use App\Abstracts\View\Component; use App\Abstracts\View\Component;
use App\Traits\DateTime; use App\Traits\DateTime;
use App\Traits\Translations;
use Illuminate\Support\Str; use Illuminate\Support\Str;
class SearchString extends Component class SearchString extends Component
{ {
use DateTime; use DateTime, Translations;
public $filters; public $filters;
@ -203,16 +204,16 @@ class SearchString extends Component
$values = [ $values = [
[ [
'key' => 0, 'key' => 0,
'value' => empty($options['translation']) ? trans('general.no') : trans($options['translation'][0]), 'value' => empty($options['translation']) ? trans('general.no') : $this->findTranslation($options['translation'][0], 1),
], ],
[ [
'key' => 1, 'key' => 1,
'value' => empty($options['translation']) ? trans('general.yes') : trans($options['translation'][1]), 'value' => empty($options['translation']) ? trans('general.yes') : $this->findTranslation($options['translation'][1], 1),
], ],
]; ];
} else if (isset($options['values'])) { } else if (isset($options['values'])) {
foreach ($options['values'] as $key => $value) { foreach ($options['values'] as $key => $value) {
$values[$key] = trans($value); $values[$key] = $this->findTranslation($value, 1);
} }
} else if ($search = request()->get('search', false)) { } else if ($search = request()->get('search', false)) {
$fields = explode(' ', $search); $fields = explode(' ', $search);

View File

@ -60,7 +60,7 @@
<tr> <tr>
<td style="width: 60%; padding: 15px 0 15px 0;"> <td style="width: 60%; padding: 15px 0 15px 0;">
<h2 style="font-size: 12px; font-weight:600;"> <h2 style="font-size: 12px; font-weight:600;">
{{ trans($textContentTitle) }} {{ $textContentTitle != trans_choice($textContentTitle, 1) ? trans_choice($textContentTitle, 1) : trans($textContentTitle) }}
</h2> </h2>
</td> </td>
</tr> </tr>