|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace FaithGen\Sermons\Providers; |
|
4
|
|
|
|
|
5
|
|
|
use FaithGen\SDK\Traits\ConfigTrait; |
|
6
|
|
|
use FaithGen\Sermons\Models\Sermon; |
|
7
|
|
|
use FaithGen\Sermons\Observers\SermonObserver; |
|
8
|
|
|
use FaithGen\Sermons\SermonService; |
|
9
|
|
|
use Illuminate\Support\ServiceProvider; |
|
10
|
|
|
|
|
11
|
|
|
class SermonsServiceProvider extends ServiceProvider |
|
12
|
|
|
{ |
|
13
|
|
|
use ConfigTrait; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Bootstrap services. |
|
17
|
|
|
* |
|
18
|
|
|
* @return void |
|
19
|
|
|
*/ |
|
20
|
|
|
public function boot() |
|
21
|
|
|
{ |
|
22
|
|
|
$this->registerRoutes(__DIR__.'/../../routes/sermons.php', __DIR__.'/../../routes/source.php'); |
|
23
|
|
|
|
|
24
|
|
|
$this->setUpSourceFiles(function () { |
|
25
|
|
|
$this->loadMigrationsFrom(__DIR__.'/../../database/migrations/'); |
|
|
|
|
|
|
26
|
|
|
|
|
27
|
|
|
$this->publishes([ |
|
|
|
|
|
|
28
|
|
|
__DIR__.'/../../database/migrations/' => database_path('migrations'), |
|
29
|
|
|
], 'faithgen-sermons-migrations'); |
|
30
|
|
|
|
|
31
|
|
|
$this->publishes([ |
|
32
|
|
|
__DIR__.'/../../storage/sermons/' => storage_path('app/public/sermons'), |
|
33
|
|
|
], 'faithgen-sermons-storage'); |
|
34
|
|
|
}); |
|
35
|
|
|
|
|
36
|
|
|
$this->publishes([ |
|
37
|
|
|
__DIR__.'/../../config/faithgen-sermons.php' => config_path('faithgen-sermons.php'), |
|
38
|
|
|
], 'faithgen-sermons-config'); |
|
39
|
|
|
|
|
40
|
|
|
Sermon::observe(SermonObserver::class); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Register services. |
|
45
|
|
|
* |
|
46
|
|
|
* @return void |
|
47
|
|
|
*/ |
|
48
|
|
|
public function register() |
|
49
|
|
|
{ |
|
50
|
|
|
$this->mergeConfigFrom(__DIR__.'/../../config/faithgen-sermons.php', 'faithgen-sermons'); |
|
|
|
|
|
|
51
|
|
|
|
|
52
|
|
|
$this->app->singleton(SermonService::class); |
|
|
|
|
|
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* The config you want to be applied onto your routes. |
|
57
|
|
|
* @return array the rules eg, middleware, prefix, namespace |
|
58
|
|
|
*/ |
|
59
|
|
|
public function routeConfiguration(): array |
|
60
|
|
|
{ |
|
61
|
|
|
return [ |
|
62
|
|
|
'prefix' => config('faithgen-sermons.prefix'), |
|
63
|
|
|
'middleware' => config('faithgen-sermons.middlewares'), |
|
64
|
|
|
]; |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|
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.