1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace ag84ark\AwsSesBounceComplaintHandler; |
4
|
|
|
|
5
|
|
|
use Illuminate\Support\ServiceProvider; |
6
|
|
|
|
7
|
|
|
class AwsSesBounceComplaintHandlerServiceProvider extends ServiceProvider |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* Perform post-registration booting of services. |
11
|
|
|
*/ |
12
|
13 |
|
public function boot(): void |
13
|
|
|
{ |
14
|
|
|
// $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'ag84ark'); |
15
|
|
|
// $this->loadViewsFrom(__DIR__.'/../resources/views', 'ag84ark'); |
16
|
13 |
|
$this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
17
|
13 |
|
$this->loadRoutesFrom(__DIR__.'/../routes/routes.php'); |
18
|
|
|
|
19
|
|
|
// Publishing is only necessary when using the CLI. |
20
|
13 |
|
if ($this->app->runningInConsole()) { |
21
|
13 |
|
$this->bootForConsole(); |
22
|
|
|
} |
23
|
13 |
|
} |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Register any package services. |
27
|
|
|
* |
28
|
|
|
* @return void |
29
|
|
|
*/ |
30
|
13 |
|
public function register() |
31
|
|
|
{ |
32
|
13 |
|
$this->mergeConfigFrom(__DIR__.'/../config/aws-ses-bounce-complaint-handler.php', 'aws-ses-bounce-complaint-handler'); |
33
|
|
|
|
34
|
|
|
// Register the service the package provides. |
35
|
|
|
$this->app->singleton('aws-ses-bounce-complaint-handler', function ($app) { |
|
|
|
|
36
|
4 |
|
return new AwsSesBounceComplaintHandler(); |
37
|
13 |
|
}); |
38
|
13 |
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Get the services provided by the provider. |
42
|
|
|
*/ |
43
|
|
|
public function provides(): array |
44
|
|
|
{ |
45
|
|
|
return ['aws-ses-bounce-complaint-handler']; |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Console-specific booting. |
50
|
|
|
*/ |
51
|
13 |
|
protected function bootForConsole(): void |
52
|
|
|
{ |
53
|
|
|
// Publishing the configuration file. |
54
|
13 |
|
$this->publishes([ |
55
|
13 |
|
__DIR__.'/../config/aws-ses-bounce-complaint-handler.php' => config_path('aws-ses-bounce-complaint-handler.php'), |
56
|
13 |
|
], 'aws-ses-bounce-complaint-handler.config'); |
57
|
|
|
|
58
|
13 |
|
if (! class_exists('CreateWrongEmailsTable')) { |
59
|
|
|
$this->publishes([ |
60
|
|
|
__DIR__.'/../database/migrations/create_wrong_emails_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_wrong_emails_table.php'), |
61
|
|
|
], 'migrations'); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
// Publishing the views. |
65
|
|
|
/*$this->publishes([ |
66
|
|
|
__DIR__.'/../resources/views' => base_path('resources/views/vendor/ag84ark'), |
67
|
|
|
], 'aws-ses-bounce-complaint-handler.views');*/ |
68
|
|
|
|
69
|
|
|
// Publishing assets. |
70
|
|
|
/*$this->publishes([ |
71
|
|
|
__DIR__.'/../resources/assets' => public_path('vendor/ag84ark'), |
72
|
|
|
], 'aws-ses-bounce-complaint-handler.views');*/ |
73
|
|
|
|
74
|
|
|
// Publishing the translation files. |
75
|
|
|
/*$this->publishes([ |
76
|
|
|
__DIR__.'/../resources/lang' => resource_path('lang/vendor/ag84ark'), |
77
|
|
|
], 'aws-ses-bounce-complaint-handler.views');*/ |
78
|
|
|
|
79
|
|
|
// Register)ing package commands. |
80
|
|
|
// // $this->commands([]; |
81
|
13 |
|
} |
82
|
|
|
} |
83
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.