| Total Complexity | 5 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class ToastComponent extends Component |
||
| 16 | { |
||
| 17 | public int $duration; |
||
| 18 | |||
| 19 | public int $loadDelay; |
||
| 20 | |||
| 21 | public bool $prod; |
||
| 22 | |||
| 23 | public array $toasts = []; |
||
| 24 | |||
| 25 | public function dehydrate(): void |
||
| 26 | { |
||
| 27 | ToastManager::setComponentRendered(true); |
||
| 28 | |||
| 29 | $this->toasts = array_merge($this->toasts, ToastManager::pull()); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function mount(): void |
||
| 33 | { |
||
| 34 | if (session()->has(config('tall-toasts.session_keys.toasts_next_page'))) { |
||
| 35 | $this->toasts = ToastManager::pullNextPage(); |
||
| 36 | } |
||
| 37 | |||
| 38 | $this->duration = config('tall-toasts.duration'); |
||
| 39 | |||
| 40 | $this->loadDelay = config('tall-toasts.load_delay'); |
||
| 41 | |||
| 42 | $this->prod = App::isProduction(); |
||
| 43 | } |
||
| 44 | |||
| 45 | public function render(): View|Factory|Application |
||
| 48 | } |
||
| 49 | |||
| 50 | public function updatedProd(): void |
||
| 53 | } |
||
| 54 | } |
||
| 55 |