File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/Illuminate/Console/Scheduling Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Illuminate \Console \Scheduling ;
4
4
5
+ use Illuminate \Console \Application ;
5
6
use Illuminate \Console \Command ;
6
- use Illuminate \Support \Str ;
7
7
use Symfony \Component \Console \Attribute \AsCommand ;
8
8
9
9
#[AsCommand(name: 'schedule:test ' )]
@@ -55,7 +55,11 @@ public function handle(Schedule $schedule)
55
55
}
56
56
57
57
if (! empty ($ name = $ this ->option ('name ' ))) {
58
- $ matches = array_filter ($ commandNames , fn ($ commandName ) => Str::endsWith ($ commandName , $ name ));
58
+ $ commandBinary = Application::phpBinary ().' ' .Application::artisanBinary ();
59
+
60
+ $ matches = array_filter ($ commandNames , function ($ commandName ) use ($ commandBinary , $ name ) {
61
+ return trim (str_replace ($ commandBinary , '' , $ commandName )) === $ name ;
62
+ });
59
63
60
64
if (count ($ matches ) !== 1 ) {
61
65
return $ this ->error ('No matching scheduled command found. ' );
You can’t perform that action at this time.
0 commit comments