← All changes
|
app/Features/Notifications/Notices/ExampleNotice.php
+56
-0
2.0.0
→
2.1.1
View file →
| @@ -1,0 +1,56 @@ | ||
| 1 | +<?php | |
| 2 | + | |
| 3 | +declare(strict_types=1); | |
| 4 | + | |
| 5 | +namespace Metricool\Features\Notifications\Notices; | |
| 6 | + | |
| 7 | +class ExampleNotice extends AbstractNotice | |
| 8 | +{ | |
| 9 | + public const IDENTIFIER = 'example_notice'; | |
| 10 | + protected bool $active = true; | |
| 11 | + | |
| 12 | + /** | |
| 13 | + * @inheritDoc | |
| 14 | + */ | |
| 15 | + public function getTitle(): string | |
| 16 | + { | |
| 17 | + return __('This is a notice without a route.', 'metricool'); | |
| 18 | + } | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * @inheritDoc | |
| 22 | + */ | |
| 23 | + public function getText(): string | |
| 24 | + { | |
| 25 | + return __('This is a notice without a route.', 'metricool'); | |
| 26 | + } | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * @inheritDoc | |
| 30 | + */ | |
| 31 | + public function getType(): string | |
| 32 | + { | |
| 33 | + return self::TYPE_INFO; | |
| 34 | + } | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * @inheritDoc | |
| 38 | + */ | |
| 39 | + public function getRoute(): string | |
| 40 | + { | |
| 41 | + return self::ALL_ROUTES; | |
| 42 | + } | |
| 43 | + | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * @inheritDoc | |
| 47 | + */ | |
| 48 | + public function getAction(): array | |
| 49 | + { | |
| 50 | + return [ | |
| 51 | + 'text' => __('Example text', 'metricool'), | |
| 52 | + 'link' => 'https://example.test', | |
| 53 | + 'target' => '_blank', | |
| 54 | + ]; | |
| 55 | + } | |
| 56 | +} | |