@@ -117,6 +117,13 @@ class Application extends Container implements ApplicationContract, CachesConfig
117
117
*/
118
118
protected $ appPath ;
119
119
120
+ /**
121
+ * The custom configuration path defined by the developer.
122
+ *
123
+ * @var string
124
+ */
125
+ protected $ configPath ;
126
+
120
127
/**
121
128
* The custom database path defined by the developer.
122
129
*
@@ -357,9 +364,7 @@ protected function bindPathsInContainer()
357
364
*/
358
365
public function path ($ path = '' )
359
366
{
360
- $ appPath = $ this ->appPath ?: $ this ->basePath ('app ' );
361
-
362
- return $ this ->joinPaths ($ appPath , $ path );
367
+ return $ this ->joinPaths ($ this ->appPath ?: $ this ->basePath ('app ' ), $ path );
363
368
}
364
369
365
370
/**
@@ -422,7 +427,22 @@ public function useBootstrapPath($path)
422
427
*/
423
428
public function configPath ($ path = '' )
424
429
{
425
- return $ this ->joinPaths ($ this ->basePath ('config ' ), $ path );
430
+ return $ this ->joinPaths ($ this ->configPath ?: $ this ->basePath ('config ' ), $ path );
431
+ }
432
+
433
+ /**
434
+ * Set the configuration directory.
435
+ *
436
+ * @param string $path
437
+ * @return $this
438
+ */
439
+ public function useConfigPath ($ path )
440
+ {
441
+ $ this ->configPath = $ path ;
442
+
443
+ $ this ->instance ('path.config ' , $ path );
444
+
445
+ return $ this ;
426
446
}
427
447
428
448
/**
@@ -433,9 +453,7 @@ public function configPath($path = '')
433
453
*/
434
454
public function databasePath ($ path = '' )
435
455
{
436
- $ databasePath = $ this ->databasePath ?: $ this ->basePath ('database ' );
437
-
438
- return $ this ->joinPaths ($ databasePath , $ path );
456
+ return $ this ->joinPaths ($ this ->databasePath ?: $ this ->basePath ('database ' ), $ path );
439
457
}
440
458
441
459
/**
@@ -487,9 +505,7 @@ public function useLangPath($path)
487
505
*/
488
506
public function publicPath ($ path = '' )
489
507
{
490
- $ publicPath = $ this ->publicPath ?: $ this ->basePath ('public ' );
491
-
492
- return $ this ->joinPaths ($ publicPath , $ path );
508
+ return $ this ->joinPaths ($ this ->publicPath ?: $ this ->basePath ('public ' ), $ path );
493
509
}
494
510
495
511
/**
@@ -515,9 +531,7 @@ public function usePublicPath($path)
515
531
*/
516
532
public function storagePath ($ path = '' )
517
533
{
518
- $ storagePath = $ this ->storagePath ?: $ this ->basePath ('storage ' );
519
-
520
- return $ this ->joinPaths ($ storagePath , $ path );
534
+ return $ this ->joinPaths ($ this ->storagePath ?: $ this ->basePath ('storage ' ), $ path );
521
535
}
522
536
523
537
/**
0 commit comments