set the notification getting system by created_at desc order
This commit is contained in:
@@ -12,8 +12,13 @@ class NotificationsController extends Controller
|
||||
{
|
||||
public function getNotifications(Request $request): JsonResponse {
|
||||
try {
|
||||
$notif = $request->user()
|
||||
->notifications()
|
||||
->latest()
|
||||
->get();
|
||||
|
||||
return response()->json([
|
||||
'data' => $request->user()->notifications
|
||||
'data' => $notif
|
||||
]);
|
||||
} catch(\Exception $e) {
|
||||
Log::info($e->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user