Skip to content

Commit

Permalink
Bring tests to green
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebronner committed Sep 15, 2017
1 parent 8c9e3e8 commit 4108a9e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
22 changes: 22 additions & 0 deletions src/Console/Commands/Publish.php
@@ -0,0 +1,22 @@
<?php namespace GeneaLabs\LaravelCaffeine\Console\Commands;

use GeneaLabs\LaravelCaffeine\Providers\Service;
use Illuminate\Console\Command;
use Illuminate\Contracts\Console\Kernel;

class Publish extends Command
{
protected $signature = 'caffeine:publish {--config}';
protected $description = 'Publish configuration file of the Caffeine for Laravel package.';

public function handle()
{
if ($this->option('config')) {
$this->call('vendor:publish', [
'--provider' => Service::class,
'--tag' => ['config'],
'--force' => true,
]);
}
}
}
8 changes: 7 additions & 1 deletion src/Providers/Service.php
@@ -1,5 +1,6 @@
<?php namespace GeneaLabs\LaravelCaffeine\Providers;

use GeneaLabs\LaravelCaffeine\Console\Commands\Publish;
use GeneaLabs\LaravelCaffeine\Http\Middleware\LaravelCaffeineDripMiddleware;
use Illuminate\Support\ServiceProvider;

Expand All @@ -15,11 +16,16 @@ public function boot()
require __DIR__ . '/../../routes/web.php';
});

$this->publishes([__DIR__ . '/../../config/genealabs-laravel-caffeine.php' => config_path('genealabs-laravel-caffeine.php')], 'genealabs-laravel-caffeine');
$configPath = __DIR__ . '/../../config/genealabs-laravel-caffeine.php';
$this->mergeConfigFrom($configPath, 'genealabs-laravel-caffeine');
$this->publishes([
$configPath => config_path('genealabs-laravel-caffeine.php')
], 'config');
}

public function register()
{
$this->commands(Publish::class);
$this->mergeConfigFrom(__DIR__ . '/../../config/genealabs-laravel-caffeine.php', 'genealabs-laravel-caffeine');

app('Illuminate\Contracts\Http\Kernel')->pushMiddleware('\GeneaLabs\LaravelCaffeine\Http\Middleware\LaravelCaffeineDripMiddleware');
Expand Down

0 comments on commit 4108a9e

Please sign in to comment.