@@ -17,7 +17,7 @@ public static function render(array $parameters): string
17
17
18
18
$ title = self ::applyFormatting ($ title , $ sortColumn );
19
19
20
- if ($ mergeTitleAs = config ('sortable.inject_title_as ' , null )) {
20
+ if ($ mergeTitleAs = config ('sortable.inject_title_as ' )) {
21
21
request ()->merge ([$ mergeTitleAs => $ title ]);
22
22
}
23
23
@@ -60,7 +60,7 @@ public static function parseParameters(array $parameters): array
60
60
*/
61
61
public static function explodeSortParameter (string $ parameter ): array
62
62
{
63
- $ separator = config ('sortable.relation_column_separator ' , ' . ' );
63
+ $ separator = config ('sortable.relation_column_separator ' );
64
64
65
65
if (Str::contains ($ parameter , $ separator )) {
66
66
$ oneToOneSort = explode ($ separator , $ parameter );
@@ -88,11 +88,11 @@ private static function applyFormatting($title, string $sortColumn)
88
88
89
89
if ($ title === null ) {
90
90
$ title = $ sortColumn ;
91
- } elseif (! config ('sortable.format_custom_titles ' , true )) {
91
+ } elseif (! config ('sortable.format_custom_titles ' )) {
92
92
return $ title ;
93
93
}
94
94
95
- $ formatting_function = config ('sortable.formatting_function ' , null );
95
+ $ formatting_function = config ('sortable.formatting_function ' );
96
96
if (! is_null ($ formatting_function ) && function_exists ($ formatting_function )) {
97
97
$ title = call_user_func ($ formatting_function , $ title );
98
98
}
@@ -106,15 +106,15 @@ private static function determineDirection($sortColumn, $sortParameter): array
106
106
107
107
if ((request ()->get ('sort ' ) == $ sortParameter ) && in_array (request ()->get ('direction ' ), ['asc ' , 'desc ' ])) {
108
108
$ icon .= (request ()->get ('direction ' ) === 'asc ' )
109
- ? config ('sortable.asc_suffix ' , ' -asc ' )
110
- : config ('sortable.desc_suffix ' , ' -desc ' );
109
+ ? config ('sortable.asc_suffix ' )
110
+ : config ('sortable.desc_suffix ' );
111
111
112
112
$ direction = request ()->get ('direction ' ) === 'desc ' ? 'asc ' : 'desc ' ;
113
113
114
114
return [$ icon , $ direction ];
115
115
} else {
116
116
$ icon = config ('sortable.icons.sortable ' );
117
- $ direction = config ('sortable.default_direction_unsorted ' , ' asc ' );
117
+ $ direction = config ('sortable.default_direction_unsorted ' );
118
118
119
119
return [$ icon , $ direction ];
120
120
}
@@ -133,13 +133,16 @@ private static function selectIcon($sortColumn): string
133
133
return $ icon ;
134
134
}
135
135
136
- private static function formTrailingTag (string $ icon ): string
136
+ /**
137
+ * @param string|null $icon
138
+ */
139
+ private static function formTrailingTag ($ icon ): string
137
140
{
138
- if (! config ('sortable.icons.enabled ' , true )) {
141
+ if (! config ('sortable.icons.enabled ' )) {
139
142
return '</a> ' ;
140
143
}
141
144
142
- $ clickableIcon = config ('sortable.icons.clickable ' , false );
145
+ $ clickableIcon = config ('sortable.icons.clickable ' );
143
146
$ trailingTag = static ::getIconHtml ($ icon ) . '</a> ' ;
144
147
145
148
if ($ clickableIcon === false ) {
@@ -158,17 +161,17 @@ private static function getAnchorClass(string $sortColumn, array &$anchorAttribu
158
161
{
159
162
$ class = [];
160
163
161
- $ anchorClass = config ('sortable.anchor_class ' , null );
164
+ $ anchorClass = config ('sortable.anchor_class ' );
162
165
if ($ anchorClass !== null ) {
163
166
$ class [] = $ anchorClass ;
164
167
}
165
168
166
- $ activeClass = config ('sortable.active_anchor_class ' , null );
169
+ $ activeClass = config ('sortable.active_anchor_class ' );
167
170
if ($ activeClass !== null && self ::shouldShowActive ($ sortColumn )) {
168
171
$ class [] = $ activeClass ;
169
172
}
170
173
171
- $ directionClassPrefix = config ('sortable.direction_anchor_class_prefix ' , null );
174
+ $ directionClassPrefix = config ('sortable.direction_anchor_class_prefix ' );
172
175
if ($ directionClassPrefix !== null && self ::shouldShowActive ($ sortColumn )) {
173
176
$ class [] = $ directionClassPrefix . (request ()->get ('direction ' ) === 'asc ' )
174
177
? config ('sortable.asc_suffix ' , '-asc ' )
0 commit comments