'integer', 'data' => 'array', 'connected' => 'boolean', 'is_default' => 'boolean', ]; public function provider(): \App\NotificationChannels\NotificationChannel { $class = config('core.notification_channels_providers_class')[$this->provider]; return new $class($this); } public static function notifyAll(NotificationInterface $notification): void { $channels = self::all(); foreach ($channels as $channel) { $channel->notify($notification); } } public function project(): BelongsTo { return $this->belongsTo(Project::class); } public static function getByProjectId(int $projectId): Builder { return self::query() ->where('project_id', $projectId) ->orWhereNull('project_id'); } }