File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
src/Illuminate/Foundation/Console Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 15
15
use League \Flysystem \Visibility ;
16
16
use Symfony \Component \Console \Attribute \AsCommand ;
17
17
18
+ use function Laravel \Prompts \search ;
18
19
use function Laravel \Prompts \select ;
19
20
20
21
#[AsCommand(name: 'vendor:publish ' )]
@@ -114,11 +115,23 @@ protected function determineWhatShouldBePublished()
114
115
*/
115
116
protected function promptForProviderOrTag ()
116
117
{
117
- $ choice = select (
118
- "Which provider or tag's files would you like to publish? " ,
119
- $ choices = $ this ->publishableChoices (),
120
- scroll: 15 ,
121
- );
118
+ $ choices = $ this ->publishableChoices ();
119
+
120
+ $ choice = windows_os ()
121
+ ? select (
122
+ "Which provider or tag's files would you like to publish? " ,
123
+ $ choices ,
124
+ scroll: 15 ,
125
+ )
126
+ : search (
127
+ label: "Which provider or tag's files would you like to publish? " ,
128
+ placeholder: 'Search... ' ,
129
+ options: fn ($ search ) => array_filter (
130
+ $ choices ,
131
+ fn ($ choice ) => str_contains (strtolower ($ choice ), strtolower ($ search ))
132
+ ),
133
+ scroll: 15 ,
134
+ );
122
135
123
136
if ($ choice == $ choices [0 ] || is_null ($ choice )) {
124
137
return ;
You can’t perform that action at this time.
0 commit comments