Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Http\Resources;
- use App\Models\Course;
- use App\Models\Lecture;
- use App\Models\Quiz;
- use Illuminate\Http\Resources\Json\JsonResource;
- use Illuminate\Support\Facades\Auth;
- class CurriculumLectureResource extends JsonResource
- {
- public function toArray($request)
- {
- $lectureId = $request->lecture_id;
- return [
- 'id' => $this->id,
- 'title_section' => json_decode($this->title_section),
- 'learning_objective'=> json_decode($this->learning_objective),
- 'lecture_detail' => LectureDisplayResource::collection(new LectureDisplayResource(
- Lecture::where('id','=',$lectureId)
- ->get())
- ),
- 'parent_id' => $this->id,
- 'course_id' => $this->course_id,
- ];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement