0

I can return an object using -

$firstUnseenMessage = Message::where(['sender_id' => $id, 'receiver_id' => auth()->id(), 'seen' => 0])->first(); 

But I want to get the number at which this row exists from the top.

Debarshi Das
  • 49
  • 1
  • 9
  • `$firstUnseenMessage->id` ? – STA Mar 05 '21 at 14:58
  • Does this answer your question? [Laravel how do I get the row number of an object using Eloquent?](https://stackoverflow.com/questions/23408091/laravel-how-do-i-get-the-row-number-of-an-object-using-eloquent) – Ion Mar 05 '21 at 15:02
  • No, I don't want the id, because it may not be the actual position from the top if some records are deleted. I want the actual position from the top of the table of a row. – Debarshi Das Mar 05 '21 at 15:05

0 Answers0