Search string add key for label
This commit is contained in:
@ -52,7 +52,7 @@ class SearchString extends Component
|
||||
|
||||
$this->filters[] = [
|
||||
'key' => $this->getFilterKey($column, $options),
|
||||
'value' => $this->getFilterName($column),
|
||||
'value' => $this->getFilterName($column, $options),
|
||||
'type' => $this->getFilterType($options),
|
||||
'url' => $this->getFilterUrl($column, $options),
|
||||
'values' => $this->getFilterValues($column, $options),
|
||||
@ -83,7 +83,7 @@ class SearchString extends Component
|
||||
return $column;
|
||||
}
|
||||
|
||||
protected function getFilterName($column)
|
||||
protected function getFilterName($column, $options)
|
||||
{
|
||||
if (strpos($column, '_id') !== false) {
|
||||
$column = str_replace('_id', '', $column);
|
||||
@ -91,6 +91,10 @@ class SearchString extends Component
|
||||
$column = str_replace('_code', '', $column);
|
||||
}
|
||||
|
||||
if (!empty($options['key'])) {
|
||||
$column = $options['key'];
|
||||
}
|
||||
|
||||
$plural = Str::plural($column, 2);
|
||||
|
||||
if (trans_choice('general.' . $plural, 1) !== 'general.' . $plural) {
|
||||
|
Reference in New Issue
Block a user