Kaynağa Gözat

:construction:create

visuddhinanda 1 yıl önce
ebeveyn
işleme
bf72ac3c75
1 değiştirilmiş dosya ile 20 ekleme ve 0 silme
  1. 20 0
      app/Http/Api/CourseApi.php

+ 20 - 0
app/Http/Api/CourseApi.php

@@ -0,0 +1,20 @@
+<?php
+namespace App\Http\Api;
+
+use App\Models\CourseMember;
+use Illuminate\Support\Facades\Log;
+
+class CourseApi{
+    public static function getStudentChannels($courseId){
+        $channels = [];
+        $studentsChannel = CourseMember::where('course_id',$courseId)
+                ->whereNotNull('channel_id')
+                ->select('channel_id')
+                ->orderBy('created_at')
+                ->get();
+        foreach ($studentsChannel as $key => $channel) {
+            $channels[] = $channel->channel_id;
+        }
+        return $channels;
+    }
+}