|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Astrotomic\Stancy; |
|
4
|
|
|
|
|
5
|
|
|
use Astrotomic\Stancy\Commands\MakePageCommand; |
|
6
|
|
|
use Astrotomic\Stancy\Contracts\ExportFactory as ExportFactoryContract; |
|
7
|
|
|
use Astrotomic\Stancy\Contracts\FeedFactory as FeedFactoryContract; |
|
8
|
|
|
use Astrotomic\Stancy\Contracts\Page as PageContract; |
|
9
|
|
|
use Astrotomic\Stancy\Contracts\PageFactory as PageFactoryContract; |
|
10
|
|
|
use Astrotomic\Stancy\Contracts\SitemapFactory as SitemapFactoryContract; |
|
11
|
|
|
use Astrotomic\Stancy\Factories\ExportFactory; |
|
12
|
|
|
use Astrotomic\Stancy\Factories\FeedFactory; |
|
13
|
|
|
use Astrotomic\Stancy\Factories\PageFactory; |
|
14
|
|
|
use Astrotomic\Stancy\Factories\SitemapFactory; |
|
15
|
|
|
use Astrotomic\Stancy\Models\Page; |
|
16
|
|
|
use Illuminate\Support\ServiceProvider; |
|
17
|
|
|
|
|
18
|
|
|
class StancyServiceProvider extends ServiceProvider |
|
19
|
|
|
{ |
|
20
|
58 |
|
public function boot(): void |
|
21
|
|
|
{ |
|
22
|
58 |
|
$this->commands([ |
|
23
|
58 |
|
MakePageCommand::class, |
|
24
|
|
|
]); |
|
25
|
58 |
|
} |
|
26
|
|
|
|
|
27
|
58 |
|
public function register(): void |
|
28
|
|
|
{ |
|
29
|
58 |
|
$this->registerPage(); |
|
30
|
58 |
|
$this->registerFeed(); |
|
31
|
58 |
|
$this->registerSitemap(); |
|
32
|
58 |
|
$this->registerExporter(); |
|
33
|
58 |
|
} |
|
34
|
|
|
|
|
35
|
58 |
|
protected function registerPage(): void |
|
36
|
|
|
{ |
|
37
|
58 |
|
$this->app->singleton(PageFactoryContract::class, PageFactory::class); |
|
38
|
58 |
|
$this->app->bind(PageContract::class, Page::class); |
|
39
|
58 |
|
} |
|
40
|
|
|
|
|
41
|
58 |
|
protected function registerFeed(): void |
|
42
|
|
|
{ |
|
43
|
58 |
|
$this->app->singleton(FeedFactoryContract::class, FeedFactory::class); |
|
44
|
58 |
|
} |
|
45
|
|
|
|
|
46
|
58 |
|
protected function registerSitemap(): void |
|
47
|
|
|
{ |
|
48
|
58 |
|
$this->app->singleton(SitemapFactoryContract::class, SitemapFactory::class); |
|
49
|
58 |
|
} |
|
50
|
|
|
|
|
51
|
58 |
|
protected function registerExporter(): void |
|
52
|
|
|
{ |
|
53
|
58 |
|
$this->app->singleton(ExportFactoryContract::class, ExportFactory::class); |
|
54
|
58 |
|
} |
|
55
|
|
|
} |
|
56
|
|
|
|