File tree 2 files changed +18
-11
lines changed
2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,6 @@ public function fire()
58
58
return $ this ->error ("Your application doesn't have any routes. " );
59
59
}
60
60
61
- $ routes ->refreshNameLookups ();
62
- $ routes ->refreshActionLookups ();
63
-
64
61
foreach ($ routes as $ route ) {
65
62
$ route ->prepareForSerialization ();
66
63
}
@@ -79,11 +76,22 @@ public function fire()
79
76
*/
80
77
protected function getFreshApplicationRoutes ()
81
78
{
82
- $ app = require $ this ->laravel ->bootstrapPath ().'/app.php ' ;
83
-
84
- $ app ->make (ConsoleKernelContract::class)->bootstrap ();
79
+ return tap ($ this ->getFreshApplication ()['router ' ]->getRoutes (), function ($ routes ) {
80
+ $ routes ->refreshNameLookups ();
81
+ $ routes ->refreshActionLookups ();
82
+ });
83
+ }
85
84
86
- return $ app ['router ' ]->getRoutes ();
85
+ /**
86
+ * Get a fresh application instance.
87
+ *
88
+ * @return \Illuminate\Foundation\Application
89
+ */
90
+ protected function getFreshApplication ()
91
+ {
92
+ return tap (require $ this ->laravel ->bootstrapPath ().'/app.php ' , function ($ app ) {
93
+ $ app ->make (ConsoleKernelContract::class)->bootstrap ();
94
+ });
87
95
}
88
96
89
97
/**
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ public function refreshNameLookups()
131
131
/**
132
132
* Refresh the action look-up table.
133
133
*
134
- * This is done in case any actions are fluently defined or if routes are overwritten .
134
+ * This is done in case any actions are overwritten with new controllers .
135
135
*
136
136
* @return void
137
137
*/
@@ -140,9 +140,8 @@ public function refreshActionLookups()
140
140
$ this ->actionList = [];
141
141
142
142
foreach ($ this ->allRoutes as $ route ) {
143
- $ action = $ route ->getAction ();
144
- if (isset ($ action ['controller ' ])) {
145
- $ this ->addToActionList ($ action , $ route );
143
+ if (isset ($ route ->getAction ()['controller ' ])) {
144
+ $ this ->addToActionList ($ route ->getAction (), $ route );
146
145
}
147
146
}
148
147
}
You can’t perform that action at this time.
0 commit comments