@@ -30,8 +30,10 @@ class BackpackServiceProvider extends ServiceProvider
3030
3131 // Indicates if loading of the provider is deferred.
3232 protected $ defer = false ;
33+
3334 // Where the route file lives, both inside the package and in the app (if overwritten).
3435 public $ routeFilePath = '/routes/backpack/base.php ' ;
36+
3537 // Where custom routes can be written, and will be registered by Backpack.
3638 public $ customRoutesFilePath = '/routes/backpack/custom.php ' ;
3739
@@ -40,7 +42,7 @@ class BackpackServiceProvider extends ServiceProvider
4042 *
4143 * @return void
4244 */
43- public function boot (\ Illuminate \ Routing \ Router $ router )
45+ public function boot (Router $ router )
4446 {
4547 $ this ->loadViewsWithFallbacks ();
4648 $ this ->loadTranslationsFrom (realpath (__DIR__ .'/resources/lang ' ), 'backpack ' );
@@ -161,6 +163,11 @@ public function publishFiles()
161163 */
162164 public function setupRoutes (Router $ router )
163165 {
166+ if (app ()->runningUnitTests ()) {
167+ $ this ->loadRoutesFrom (__DIR__ .'/routes/backpack/testing.php ' );
168+
169+ return ;
170+ }
164171 // by default, use the routes file provided in vendor
165172 $ routeFilePathInUse = __DIR__ .$ this ->routeFilePath ;
166173
@@ -259,8 +266,8 @@ public function loadConfigs()
259266 'backpack ' => [
260267 'provider ' => 'backpack ' ,
261268 'table ' => 'password_resets ' ,
262- 'expire ' => 60 ,
263- 'throttle ' => config ('backpack.base.password_recovery_throttle_notifications ' ),
269+ 'expire ' => config ( ' backpack.base.password_recovery_token_expiration ' , 60 ) ,
270+ 'throttle ' => config ('backpack.base.password_recovery_throttle_notifications ' ),
264271 ],
265272 ];
266273
0 commit comments