Skip to content

Commit fefe419

Browse files
author
Andrey Helldar
committed
The config has been merged with config/database.php
1 parent cd28d73 commit fefe419

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,21 @@ Or manually update `require` block of `composer.json` and run `composer update`.
4545
```json
4646
{
4747
"require": {
48-
"andrey-helldar/laravel-actions": "^1.4"
48+
"andrey-helldar/laravel-actions": "^1.5"
4949
}
5050
}
5151
```
5252

5353
#### Laravel Framework
5454

55-
You can also publish the config file to change implementations (ie. interface to specific class):
56-
57-
```
58-
php artisan vendor:publish --provider="Helldar\LaravelActions\ServiceProvider"
59-
```
55+
Nothing else needs to be done. All is ready 😊
6056

6157
#### Lumen Framework
6258

6359
This package is focused on Laravel development, but it can also be used in Lumen with some workarounds. Because Lumen works a little different, as it is like a
6460
barebone version of Laravel and the main configuration parameters are instead located in `bootstrap/app.php`, some alterations must be made.
6561

66-
You can install Laravel Lang Publisher in `app/Providers/AppServiceProvider.php`, and uncommenting this line that registers the App Service Providers so it can
62+
You can install `Laravel Actions` in `app/Providers/AppServiceProvider.php`, and uncommenting this line that registers the App Service Providers so it can
6763
properly load.
6864

6965
```

config/actions.php renamed to config/database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
|
1313
*/
1414

15-
'table' => 'migration_actions',
15+
'actions' => 'migration_actions',
1616
];

src/ServiceProvider.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ public function register()
3838
$this->registerCommands($this->commands);
3939
}
4040

41-
public function boot()
42-
{
43-
$this->bootConfig();
44-
}
45-
4641
public function provides()
4742
{
4843
return array_merge([
@@ -55,7 +50,7 @@ public function provides()
5550
protected function registerRepository(): void
5651
{
5752
$this->app->singleton(Action::REPOSITORY, static function ($app) {
58-
return new DatabaseMigrationRepository($app['db'], $app['config']['actions.table']);
53+
return new DatabaseMigrationRepository($app['db'], $app['config']['database.actions']);
5954
});
6055
}
6156

@@ -137,15 +132,8 @@ protected function registerMigrateRefreshCommand(): void
137132
protected function registerConfig(): void
138133
{
139134
$this->mergeConfigFrom(
140-
__DIR__ . '/../config/actions.php',
141-
'actions'
135+
__DIR__ . '/../config/database.php',
136+
'database'
142137
);
143138
}
144-
145-
protected function bootConfig(): void
146-
{
147-
$this->publishes([
148-
__DIR__ . '/../config/actions.php' => $this->app->configPath('actions.php'),
149-
], 'config');
150-
}
151139
}

tests/Concerns/Settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ trait Settings
88

99
protected function setTable($app): void
1010
{
11-
$app['config']->set('actions.table', $this->table);
11+
$app['config']->set('database.actions', $this->table);
1212
}
1313
}

0 commit comments

Comments
 (0)