getNotifications($path); foreach ($notifications as $notification) { if ($notification->id == $id) { setting()->set('notifications.'. $path . '.' . $id . '.name', $notification->name); setting()->set('notifications.'. $path . '.' . $id . '.message', $notification->message); setting()->set('notifications.'. $path . '.' . $id . '.date', Date::now()); setting()->set('notifications.'. $path . '.' . $id . '.status', '0'); setting()->save(); break; } } return response()->json([ 'success' => true, 'error' => false, 'data' => null, ]); } }