Skip to content

Commit

Permalink
defer service provider
Browse files Browse the repository at this point in the history
delete useless config
  • Loading branch information
Gummibeer committed Oct 11, 2019
1 parent f5217da commit 1113140
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
5 changes: 0 additions & 5 deletions config/stancy.php

This file was deleted.

22 changes: 9 additions & 13 deletions src/StancyServiceProvider.php
Expand Up @@ -10,30 +10,26 @@
use Astrotomic\Stancy\Factories\PageFactory;
use Astrotomic\Stancy\Factories\SitemapFactory;
use Astrotomic\Stancy\Models\Page;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;

class StancyServiceProvider extends ServiceProvider
class StancyServiceProvider extends ServiceProvider implements DeferrableProvider
{
public function boot(): void
{
$this->publishes([
__DIR__.'/../config/stancy.php' => config_path('stancy.php'),
], 'config');
}

public function register(): void
{
$this->registerConfig();
$this->registerPage();
$this->registerFeed();
$this->registerSitemap();
}

protected function registerConfig(): void
public function provides(): array
{
$this->mergeConfigFrom(
__DIR__.'/../config/stancy.php', 'stancy'
);
return [
PageFactoryContract::class,
PageContract::class,
FeedFactoryContract::class,
SitemapFactoryContract::class,
];
}

protected function registerPage(): void
Expand Down

0 comments on commit 1113140

Please sign in to comment.