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()
8282 *
8383 * @return void
8484 */
85- protected function registerUrlGenerator ()
85+ protected function registerUrlGenerator ()
8686 {
8787 $ this ->app ->singleton ('url ' , function ($ app ) {
8888 $ routes = $ app ['router ' ]->getRoutes ();
@@ -95,13 +95,20 @@ protected function registerUrlGenerator()
9595 $ url = new UrlGenerator (
9696 $ routes , $ app ->rebinding (
9797 'request ' , $ this ->requestRebinder ()
98- )
98+ ), $ app [ ' config ' ][ ' app.asset_url ' ]
9999 );
100100
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.
101104 $ url ->setSessionResolver (function () {
102105 return $ this ->app ['session ' ];
103106 });
104107
108+ $ url ->setKeyResolver (function () {
109+ return $ this ->app ->make ('config ' )->get ('app.key ' );
110+ });
111+
105112 // If the route collection is "rebound", for example, when the routes stay
106113 // cached for the application, we will need to rebind the routes on the
107114 // URL generator instance so it has the latest version of the routes.
Original file line number Diff line number Diff line change 1212class UrlGenerator extends BaseUrlGenerator
1313{
1414 /**
15- * Create a new UrlGenerator instance.
15+ * Create a new URL Generator instance.
1616 *
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
1921 */
20- public function __construct (RouteCollection $ routes , Request $ request )
22+ public function __construct (RouteCollection $ routes , Request $ request, $ assetRoot = null )
2123 {
22- parent ::__construct ($ routes , $ request );
24+ parent ::__construct ($ routes , $ request, $ assetRoot );
2325 }
2426
2527 /**
You can’t perform that action at this time.
0 commit comments