File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/Illuminate/Console/Scheduling Expand file tree Collapse file tree 1 file changed +6
-1
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
7
use Illuminate \Support \Str ;
7
8
@@ -51,7 +52,11 @@ public function handle(Schedule $schedule)
51
52
}
52
53
53
54
if (! empty ($ name = $ this ->option ('name ' ))) {
54
- $ matches = array_filter ($ commandNames , fn ($ commandName ) => Str::endsWith ($ commandName , $ name ));
55
+ $ commandBinary = Application::phpBinary ().' ' .Application::artisanBinary ();
56
+
57
+ $ matches = array_filter ($ commandNames , function ($ commandName ) use ($ commandBinary , $ name ) {
58
+ return trim (Str::replace ($ commandBinary , '' , $ commandName )) === $ name ;
59
+ });
55
60
56
61
if (count ($ matches ) !== 1 ) {
57
62
return $ this ->error ('No matching scheduled command found. ' );
You can’t perform that action at this time.
0 commit comments