File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 1111
1212class Routes extends RouteListCommand
1313{
14+ /**
15+ * Dingo router instance.
16+ *
17+ * @var \Dingo\Api\Routing\Router
18+ */
19+ protected $ router ;
20+
1421 /**
1522 * Array of route collections.
1623 *
@@ -52,7 +59,19 @@ public function __construct(Router $router)
5259 // constructor on the command class.
5360 Command::__construct ();
5461
55- $ this ->routes = $ router ->getRoutes ();
62+ $ this ->router = $ router ;
63+ }
64+
65+ /**
66+ * Execute the console command.
67+ *
68+ * @return void
69+ */
70+ public function fire ()
71+ {
72+ $ this ->routes = $ this ->router ->getRoutes ();
73+
74+ parent ::fire ();
5675 }
5776
5877 /**
@@ -64,7 +83,7 @@ protected function getRoutes()
6483 {
6584 $ routes = [];
6685
67- foreach ($ this ->routes as $ collection ) {
86+ foreach ($ this ->router -> getRoutes () as $ collection ) {
6887 foreach ($ collection ->getRoutes () as $ route ) {
6988 $ routes [] = $ this ->filterRoute ([
7089 'host ' => $ route ->domain (),
You can’t perform that action at this time.
0 commit comments