Skip to content

Commit 88ededf

Browse files
committed
Add Laravel ServiceProvider
1 parent 3296081 commit 88ededf

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All Notable changes to **DotEnv Updater** will be documented in this file.
44

5+
## 1.0.0 (2020-01-01)
6+
7+
- Add Laravel `ServiceProvider`.
8+
59
## 1.0.0 (2019-12-31)
610

711
- Set and get `string`, `integer`, `boolean`, `null` and empty values.

composer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434
"CodeZero\\DotEnvUpdater\\Tests\\": "tests"
3535
}
3636
},
37+
"extra": {
38+
"laravel": {
39+
"providers": [
40+
"CodeZero\\DotEnvUpdater\\Laravel\\DotEnvUpdaterServiceProvider"
41+
]
42+
}
43+
},
3744
"config": {
3845
"preferred-install": "dist",
3946
"sort-packages": true,
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace CodeZero\DotEnvUpdater\Laravel;
4+
5+
use CodeZero\DotEnvUpdater\DotEnvUpdater;
6+
use Illuminate\Support\ServiceProvider;
7+
8+
class DotEnvUpdaterServiceProvider extends ServiceProvider
9+
{
10+
/**
11+
* Bootstrap any application services.
12+
*
13+
* @return void
14+
*/
15+
public function boot()
16+
{
17+
//
18+
}
19+
20+
/**
21+
* Register any application services.
22+
*
23+
* @return void
24+
*/
25+
public function register()
26+
{
27+
$this->app->bind(DotEnvUpdater::class, function ($app) {
28+
return new DotEnvUpdater($app->environmentFilePath());
29+
});
30+
}
31+
}

0 commit comments

Comments
 (0)