File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ protected function mergeConfig()
82
82
*
83
83
* @return void
84
84
*/
85
- protected function registerUrlGenerator ()
85
+ protected function registerUrlGenerator ()
86
86
{
87
87
$ this ->app ->singleton ('url ' , function ($ app ) {
88
88
$ routes = $ app ['router ' ]->getRoutes ();
@@ -95,13 +95,20 @@ protected function registerUrlGenerator()
95
95
$ url = new UrlGenerator (
96
96
$ routes , $ app ->rebinding (
97
97
'request ' , $ this ->requestRebinder ()
98
- )
98
+ ), $ app [ ' config ' ][ ' app.asset_url ' ]
99
99
);
100
100
101
+ // Next we will set a few service resolvers on the URL generator so it can
102
+ // get the information it needs to function. This just provides some of
103
+ // the convenience features to this URL generator like "signed" URLs.
101
104
$ url ->setSessionResolver (function () {
102
105
return $ this ->app ['session ' ];
103
106
});
104
107
108
+ $ url ->setKeyResolver (function () {
109
+ return $ this ->app ->make ('config ' )->get ('app.key ' );
110
+ });
111
+
105
112
// If the route collection is "rebound", for example, when the routes stay
106
113
// cached for the application, we will need to rebind the routes on the
107
114
// URL generator instance so it has the latest version of the routes.
Original file line number Diff line number Diff line change 12
12
class UrlGenerator extends BaseUrlGenerator
13
13
{
14
14
/**
15
- * Create a new UrlGenerator instance.
15
+ * Create a new URL Generator instance.
16
16
*
17
- * @param \Illuminate\Routing\RouteCollection $routes
18
- * @param \Illuminate\Http\Request $request
17
+ * @param \Illuminate\Routing\RouteCollection $routes
18
+ * @param \Illuminate\Http\Request $request
19
+ * @param string $assetRoot
20
+ * @return void
19
21
*/
20
- public function __construct (RouteCollection $ routes , Request $ request )
22
+ public function __construct (RouteCollection $ routes , Request $ request, $ assetRoot = null )
21
23
{
22
- parent ::__construct ($ routes , $ request );
24
+ parent ::__construct ($ routes , $ request, $ assetRoot );
23
25
}
24
26
25
27
/**
You can’t perform that action at this time.
0 commit comments