New member
- Joined
- Feb 9, 2023
- Messages
- 3
- Thread Author
- #1
I need the position of a particular row from an already fetched the collection of models in laravel
$data=Lessions::where('status',1)->where('teacher_id',56)->get(); how to find the position of $data->where('student_id',3) We can do it by foreach loop. anyone can suggest the more optimized way, without using foreach loop. Note: i want position(from top to bottom) not id.
$data=Lessions::where('status',1)->where('teacher_id',56)->get(); how to find the position of $data->where('student_id',3) We can do it by foreach loop. anyone can suggest the more optimized way, without using foreach loop. Note: i want position(from top to bottom) not id.