Laravel onclick semua pemberitahuan dibaca
class UserNotificationsController extends Controller
{
/**
* @param int $id Notification ID
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$notification = auth()->user()->notifications()->where('id', $id)->first();
if ($notification) {
$notification->markAsRead();
return redirect($notification->data['link']);
}
}
}
Sleepy Sardine