Procházet zdrojové kódy

:construction:create

visuddhinanda před 2 roky
rodič
revize
bf72ac3c75
1 změnil soubory, kde provedl 20 přidání a 0 odebrání
  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;
+    }
+}