Skip to content

Commit

Permalink
Allow to push packages name/key to config repository.
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Feb 28, 2015
1 parent 0f8228f commit 90e98d3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Providers/ServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
<?php namespace Orchestra\Support\Providers;

use Orchestra\Contracts\Config\PackageRepository;
use Orchestra\Support\Providers\Traits\PackageProviderTrait;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;

abstract class ServiceProvider extends BaseServiceProvider
{
use PackageProviderTrait;

/**
* Merge the given configuration with the existing configuration.
*
* @param string $path
* @param string $key
* @return void
*/
protected function mergeConfigFrom($path, $key)
{
parent::mergeConfigFrom($path, $key);

$config = $this->app['config'];

if ($config instanceof PackageRepository) {
$config->file($key);
}
}
}

0 comments on commit 90e98d3

Please sign in to comment.