list_sort_place_last

Sorts an array by a lookup value and places the last element at the end.

Example

1
2
3
4
{{ $source | list_sort_place_last: 'attribute', 'lookupValue', 'contains', 'negate' }} => [
'key1' => 'value1',
'key2' => 'value2'
]

Input

Type Parameter Description Required
array source The array to sort. Comes before the | sign. Required
string attribute The attribute to sort by  
mixed lookupValue The value to sort for  
bool contains Whether to sort by a substring, defaults to false  
bool negate Whether to negate the sort, defaults to false  

Output

Type Description
array The sorted array