|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace AloiaCms; |
|
4
|
|
|
|
|
5
|
|
|
use AloiaCms\Console\ConfigCommand; |
|
6
|
|
|
use AloiaCms\Console\NewArticle; |
|
7
|
|
|
use AloiaCms\Console\SitemapCommand; |
|
8
|
|
|
use AloiaCms\Models\Article; |
|
9
|
|
|
use AloiaCms\Models\ContentBlock; |
|
10
|
|
|
use AloiaCms\Models\MetaTag; |
|
11
|
|
|
use AloiaCms\Models\Page; |
|
12
|
|
|
use Illuminate\Support\Collection; |
|
13
|
83 |
|
use Illuminate\Support\ServiceProvider; |
|
14
|
|
|
use Illuminate\Support\Str; |
|
15
|
83 |
|
|
|
16
|
|
|
class AloiaCmsServiceProvider extends ServiceProvider |
|
17
|
83 |
|
{ |
|
18
|
83 |
|
public function register() |
|
19
|
|
|
{ |
|
20
|
83 |
|
$this->mergeConfigFrom(__DIR__ . '/../config/aloiacms.php', 'aloiacms'); |
|
21
|
|
|
|
|
22
|
83 |
|
$this->bindFacades(); |
|
23
|
83 |
|
} |
|
24
|
83 |
|
|
|
25
|
|
|
public function boot() |
|
26
|
83 |
|
{ |
|
27
|
83 |
|
$this->publishes([ |
|
28
|
83 |
|
__DIR__ . '/../config/aloiacms.php' => config_path('aloiacms.php'), |
|
29
|
|
|
], 'config'); |
|
30
|
|
|
|
|
31
|
|
|
if ($this->app->runningInConsole()) { |
|
32
|
|
|
$this->commands([ |
|
33
|
83 |
|
NewArticle::class, |
|
34
|
|
|
ConfigCommand::class, |
|
35
|
|
|
SitemapCommand::class, |
|
36
|
|
|
]); |
|
37
|
|
|
} |
|
38
|
83 |
|
|
|
39
|
|
|
Collection::macro('keysToSnakeCase', function () { |
|
40
|
83 |
|
return $this->mapWithKeys(fn ($value, $key) => [Str::snake($key) => $value]); |
|
|
|
|
|
|
41
|
8 |
|
}); |
|
42
|
83 |
|
} |
|
43
|
83 |
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Bind the facades used by this package |
|
46
|
|
|
*/ |
|
47
|
|
|
private function bindFacades() |
|
48
|
|
|
{ |
|
49
|
|
|
$this->app->bind(Article::class, function () { |
|
50
|
|
|
return new Article(); |
|
51
|
|
|
}); |
|
52
|
|
|
|
|
53
|
|
|
$this->app->bind(ContentBlock::class, function () { |
|
54
|
|
|
return new ContentBlock(); |
|
55
|
|
|
}); |
|
56
|
|
|
|
|
57
|
|
|
$this->app->bind(MetaTag::class, function () { |
|
58
|
|
|
return new MetaTag(); |
|
59
|
|
|
}); |
|
60
|
|
|
|
|
61
|
|
|
$this->app->bind(Page::class, function () { |
|
62
|
|
|
return new Page(); |
|
63
|
|
|
}); |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.