ExceptionPushProvider.php
930 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Lackoxygen\ExceptionPush;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Support\ServiceProvider;
use Lackoxygen\ExceptionPush\Exception\Handler;
class ExceptionPushProvider extends ServiceProvider
{
protected array $commands = [];
/**
* @return void
*/
public function boot()
{
if ($this->app->runningInConsole()) {
$configPath = __DIR__.'/../publish/exception.push.php';
$this->publishes([
$configPath => config_path('exception.push.php')
], 'lackoxygen-exception-push');
}
}
public function register()
{
$this->app->singleton(ExceptionHandler::class, Handler::class);
$this->app->singleton('exception.push', ExceptionPush::class);
}
/**
* @return string[]
*/
public function provides(): array
{
return ['exception.push'];
}
}