| Total Complexity | 9 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class InboxRepository |
||
| 16 | { |
||
| 17 | public function fetchAll() |
||
| 18 | { |
||
| 19 | return Conversation::where('id_from', auth()->id())->orderBy('id', 'desc')->orWhere('id_to', auth()->id())->orderBy('id', 'desc')->get()->groupBy(function ($data){ |
||
|
|
|||
| 20 | return Carbon::parse($data->created_at)->format('Y-m-d'); |
||
| 21 | }); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function userExists($user) |
||
| 25 | { |
||
| 26 | if (count(User::where('name', $user)->first())) { |
||
| 27 | return true; |
||
| 28 | } else { |
||
| 29 | return false; |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | public function conversationExists($to, $from) |
||
| 44 | } |
||
| 45 | |||
| 46 | } |