Skip to content

Commit 81e70fd

Browse files
committed
Move config file / Update ServiceProvider
1 parent ba43e66 commit 81e70fd

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

src/LaravelHttpsServiceProvider.php

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,50 @@ class LaravelHttpsServiceProvider extends ServiceProvider{
2020
*/
2121
protected $defer = false;
2222

23+
/**
24+
* Location of package config file
25+
*
26+
* @var string
27+
*/
28+
protected $configPath = __DIR__ . '/../config/https-redirection.php';
29+
30+
/**
31+
* Register the service provider.
32+
*
33+
* @return void
34+
*/
35+
public function register() {
36+
$this->mergeConfigFrom($this->configPath, 'https-redirection');
37+
}
38+
2339
/**
2440
* Bootstrap any application services.
2541
*
2642
* @return void
2743
*/
28-
public function boot(){
44+
public function boot() {
2945
//Publishes
30-
$this->publishes([
31-
__DIR__.'/config/installer.php' => config_path('https-redirection.php'),
32-
], 'config');
46+
$this->publishes([$this->configPath => $this->getConfigPath()], 'config');
3347

3448
//Middleware
3549
$this->app['Illuminate\Contracts\Http\Kernel']->pushMiddleware('WinXaito\LaravelHttpsRedirect\Http\Middleware\HttpsRedirection');
3650
}
51+
52+
/**
53+
* Get the config path
54+
*
55+
* @return string
56+
*/
57+
protected function getConfigPath() {
58+
return config_path('https-redirection.php');
59+
}
60+
61+
/**
62+
* Publish the config file
63+
*
64+
* @param string $configPath
65+
*/
66+
protected function publishConfig($configPath) {
67+
$this->publishes([$configPath => config_path('debugbar.php')], 'config');
68+
}
3769
}

0 commit comments

Comments
 (0)