mirror of
https://gitlab.com/omair-personal/exchange.git
synced 2026-08-19 12:34:13 +00:00
d56f185c69
added custom field for booking updated notification updated fetch notification on frontend
31 lines
623 B
PHP
31 lines
623 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Auth;
|
|
|
|
class UserController extends Controller
|
|
{
|
|
|
|
|
|
/**
|
|
* Display the specified resource.
|
|
*
|
|
* @param \App\ChinaBankSlip $chinaBankSlip
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function show(Request $request)
|
|
{
|
|
|
|
$user = Auth::user();
|
|
return $user->loadMissing('notifications');
|
|
}
|
|
|
|
public function notifications()
|
|
{
|
|
$notifications = auth()->user()->unreadNotifications()->limit(5)->get();
|
|
return response()->json(['notifications'=>$notifications], 200);
|
|
}
|
|
}
|