@@ -54,7 +54,7 @@ protected function getRouteInformation($route)
54
54
$ result = array (
55
55
'uri ' => $ uri ?: '- ' ,
56
56
);
57
-
57
+
58
58
$ result = array_merge ($ result , $ action );
59
59
60
60
@@ -73,82 +73,27 @@ protected function getRouteInformation($route)
73
73
$ filename = ltrim (str_replace (base_path (), '' , $ reflector ->getFileName ()), '/ ' );
74
74
$ result ['file ' ] = $ filename . ': ' . $ reflector ->getStartLine () . '- ' . $ reflector ->getEndLine ();
75
75
}
76
-
77
- if ($ before = $ this ->getBeforeFilters ($ route )) {
78
- $ result ['before ' ] = $ before ;
79
- }
80
-
81
- if ($ after = $ this ->getAfterFilters ($ route )) {
82
- $ result ['after ' ] = $ after ;
76
+
77
+ if ($ middleware = $ this ->getMiddleware ($ route )) {
78
+ $ result ['middleware ' ] = $ middleware ;
83
79
}
84
-
85
- return $ result ;
86
- }
87
80
88
- /**
89
- * Get before filters
90
- *
91
- * @param \Illuminate\Routing\Route $route
92
- * @return string
93
- */
94
- protected function getBeforeFilters ($ route )
95
- {
96
- $ before = array_keys ($ route ->beforeFilters ());
97
81
98
- $ before = array_unique (array_merge ($ before , $ this ->getPatternFilters ($ route )));
99
82
100
- return implode ( ' , ' , $ before ) ;
83
+ return $ result ;
101
84
}
102
85
103
- /*
104
- * The following is copied/modified from the RoutesCommand from Laravel, by Taylor Otwell
105
- * https://github.com/laravel/framework/blob/4.1/src/Illuminate/Foundation/Console/RoutesCommand.php
106
- *
107
- */
108
-
109
86
/**
110
- * Get all of the pattern filters matching the route.
87
+ * Get middleware
111
88
*
112
89
* @param \Illuminate\Routing\Route $route
113
- * @return array
114
- */
115
- protected function getPatternFilters ($ route )
116
- {
117
- $ patterns = array ();
118
-
119
- foreach ($ route ->methods () as $ method ) {
120
- // For each method supported by the route we will need to gather up the patterned
121
- // filters for that method. We will then merge these in with the other filters
122
- // we have already gathered up then return them back out to these consumers.
123
- $ inner = $ this ->getMethodPatterns ($ route ->uri (), $ method );
124
-
125
- $ patterns = array_merge ($ patterns , array_keys ($ inner ));
126
- }
127
-
128
- return $ patterns ;
129
- }
130
-
131
- /**
132
- * Get the pattern filters for a given URI and method.
133
- *
134
- * @param string $uri
135
- * @param string $method
136
- * @return array
137
- */
138
- protected function getMethodPatterns ($ uri , $ method )
139
- {
140
- return $ this ->router ->findPatternFilters (Request::create ($ uri , $ method ));
141
- }
142
-
143
- /**
144
- * Get after filters
145
- *
146
- * @param Route $route
147
90
* @return string
148
91
*/
149
- protected function getAfterFilters ($ route )
92
+ protected function getMiddleware ($ route )
150
93
{
151
- return implode (', ' , array_keys ($ route ->afterFilters ()));
94
+ $ middleware = array_keys ($ route ->middleware ());
95
+
96
+ return implode (', ' , $ middleware );
152
97
}
153
98
154
99
/**
0 commit comments