Level 17
something like that
return $result = DB::table('YOUR_TABLE')->where('FIELD','OP','VALUE')->get()->count();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
course_user is a pivot table, How can I know if there is a result that match the condition.
\DB::table('course_user')->where([
['course_id', '=', $course->id],
['user_id', '=', auth()->id()],
])
I mean how can I return it as true or false ! Thanks
something like that
return $result = DB::table('YOUR_TABLE')->where('FIELD','OP','VALUE')->get()->count();
Please or to participate in this conversation.