first(); return $result ? $result->toArray() : []; } /** * @param $channelUserId * @return array */ public function getUserChannels($channelUserId): array { if (empty($channelUserId)) { return []; } $channels = Channel::where('channel_user_id', $channelUserId) ->where('is_enabled', 1) ->get(); return $channels ? $channels->toArray() : []; } }