@@ -23,7 +23,7 @@ class SelectTree extends Field
23
23
24
24
protected bool $ alwaysOpen = false ;
25
25
26
- protected string $ emptyLabel ;
26
+ protected string $ emptyLabel = '' ;
27
27
28
28
protected bool $ independent = true ;
29
29
@@ -167,7 +167,7 @@ public function getDisabledBranchNode(): bool
167
167
168
168
public function getEmptyLabel (): string
169
169
{
170
- return $ this ->evaluate ($ this ->emptyLabel );
170
+ return ! $ this -> emptyLabel ? __ ( ' No results found ' ) : $ this ->evaluate ($ this ->emptyLabel );
171
171
}
172
172
173
173
public function tree (string $ treeModel , string $ treeParentKey , string $ titleAttribute , Closure $ modifyQueryUsing = null ): static
@@ -188,7 +188,7 @@ private function buildTree(int $parent = null): array|Collection
188
188
}
189
189
190
190
// Check if the treeModel is not set; if yes, return an empty collection.
191
- if (! $ this ->treeModel ) {
191
+ if (!$ this ->treeModel ) {
192
192
return collect ();
193
193
}
194
194
@@ -197,7 +197,7 @@ private function buildTree(int $parent = null): array|Collection
197
197
->where ($ this ->treeParentKey , $ parent );
198
198
199
199
// If we're not at the root level and a modification callback is provided, apply it.
200
- if (! $ parent && $ this ->modifyQueryUsing ) {
200
+ if (!$ parent && $ this ->modifyQueryUsing ) {
201
201
$ defaultQuery = $ this ->evaluate ($ this ->modifyQueryUsing , ['query ' => $ defaultQuery ]);
202
202
}
203
203
0 commit comments