Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] Fix merging config #1444

Merged
merged 1 commit into from
Oct 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions src/DataTablesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,6 @@ class DataTablesServiceProvider extends ServiceProvider
*/
protected $defer = false;

/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->mergeConfigFrom(__DIR__ . '/config/datatables.php', 'datatables');

$this->publishes([
__DIR__ . '/config/datatables.php' => config_path('datatables.php'),
], 'datatables');
}

/**
* Register the service provider.
*
Expand All @@ -40,6 +26,8 @@ public function register()
require_once 'lumen.php';
}

$this->setupAssets();

$this->app->alias('datatables', DataTables::class);
$this->app->singleton('datatables', function () {
return new DataTables;
Expand All @@ -52,6 +40,20 @@ public function register()
$this->app->singleton('datatables.config', Config::class);
}

/**
* Setup package assets.
*
* @return void
*/
protected function setupAssets()
{
$this->mergeConfigFrom($config = __DIR__ . '/config/datatables.php', 'datatables');

if ($this->app->runningInConsole()) {
$this->publishes([$config => config_path('datatables.php')], 'datatables');
}
}

/**
* Check if app uses Lumen.
*
Expand Down