1 | <?php |
||
10 | class TestCommand extends Command |
||
11 | { |
||
12 | protected $signature = 'flare:test'; |
||
13 | |||
14 | protected $description = 'Send a test notification to Flare'; |
||
15 | |||
16 | /** @var \Illuminate\Config\Repository */ |
||
17 | protected $config; |
||
18 | |||
19 | public function handle(Repository $config) |
||
31 | |||
32 | protected function checkFlareKey() |
||
42 | |||
43 | public function checkFlareLogger() |
||
44 | { |
||
45 | $defaultLogChannel = $this->config->get('logging.default'); |
||
46 | |||
47 | $activeStack = $this->config->get("logging.channels.{$defaultLogChannel}"); |
||
48 | |||
49 | if (is_null($activeStack)) { |
||
50 | $this->info("❌ The default logging channel `{$defaultLogChannel}` is not configured in the `logging` config file"); |
||
51 | } |
||
52 | |||
53 | if (! isset($activeStack['channels']) || ! in_array('flare', $activeStack['channels'])) { |
||
54 | $this->info("❌ The logging channel `{$defaultLogChannel}` does not contain the 'flare' channel"); |
||
55 | } |
||
56 | |||
57 | if (is_null($this->config->get('logging.channels.flare'))) { |
||
58 | $this->info('❌ There is no logging channel named `flare` in the `logging` config file'); |
||
59 | } |
||
60 | |||
61 | if ($this->config->get('logging.channels.flare.driver') !== 'flare') { |
||
62 | $this->info('❌ The `flare` logging channel defined in the `logging` config file is not set to `flare`.'); |
||
63 | } |
||
64 | |||
65 | $this->info('✅ The Flare logging driver was configured correctly.'); |
||
66 | |||
67 | return $this; |
||
68 | } |
||
69 | |||
70 | protected function sendTestException() |
||
85 | } |
||
86 |