Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getPurchasedCoursesId()
- {
- return $this->courses()->wherePivot('end_at','>=', Carbon::now())->get();
- }
- $course_ids = $user->getPurchasedCoursesId()
- dd($coursesids)
- Result:
- [1, 4, 6, 10]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement