Releases: Multek-Company/laravel-onesignal
Release list
v2.2.0 — derived resync + OneSignalObserver
Owns the full OneSignal lifecycle with far less app-side code: add one attribute to your model and the package keeps OneSignal in step with it.
Automatic sync via #[ObservedBy]
#[ObservedBy(OneSignalObserver::class)]
class User extends Authenticatable
{
use HasOneSignal;
}No field list, no wasChanged() guard, no enablement check, no queue lookup. On every save the observer asks oneSignalPayloadChanged(), which builds the payload from the model's current attributes and from its original attributes and compares — so a tag added to getOneSignalTags() is covered the day it lands. Handles create, update, delete (leaving soft-deleted profiles intact until forceDelete()) and restore.
The README documents the boundary rather than implying full coverage: a related row's content changing, and many-to-many attach/detach, fire no event on the user, so those need an observer on the related model plus scheduled onesignal:backfill as reconciliation.
Async delete
deleteFromOneSignalAsync() and Jobs\DeleteUserFromOneSignal complete the delete path with the same retry policy as sync — a transient 5xx no longer permanently orphans a profile. A 404 is treated as a completed erasure: logged at debug, not retried.
Lazy manager reads
OneSignalManager reads enabled, app_id and track_events from config() at call time instead of snapshotting them, and builds the SDK client on first use, so a disabled package never constructs a Guzzle client. Tests no longer need app()->forgetInstance(OneSignalManager::class) to observe a config change.
Before you upgrade
Three compatibility notes in UPGRADE.md: the removed protected validatedOneSignalPhone() helper (an override of it now silently stops running), both jobs becoming afterCommit, and direct OneSignalManager construction following config when no explicit enabled: argument is passed.
Full notes in CHANGELOG.md.
v2.1.0
What's Changed
- feat: resolve backfill model from auth provider when sync_model is empty by @rodrigocoliveira in #9
- Release v2.1.0 by @rodrigocoliveira in #10
Full Changelog: v2.0.1...v2.1.0
v2.0.1 — client SDK integration guide
Documentation-only patch on top of v2.0.0.
Adds docs/client-sdk-integration.md, explaining how this package (the server half — tags, properties, Email/SMS subscriptions, events, sending) pairs with OneSignal's web and mobile SDKs (the device half, which is the only thing that can create a push subscription):
external_idas the join key that merges browser push, mobile push, email and SMS into one OneSignal user- Web SDK setup wired to your auth state
- Mobile apps that wrap your site in a WebView — web push does not work inside
WKWebView/Android WebView, so the native SDK owns push and the page relays auth over a bridge - Rules for a consistent multi-SDK setup: single writer for user data, Identity Verification, cross-platform duplicates, staying on the v16/v5 user model
No code changes — upgrading from v2.0.0 is a no-op.
🤖 Generated with Claude Code
v2.0.0 — standalone package
laravel-onesignal is now fully standalone — the multek/laravel-customer-engagement dependency is gone, and the package owns the complete OneSignal lifecycle: profiles (identity + native properties + Email/SMS subscriptions), segmentation tags, custom events, and push notifications.
Breaking changes
- Removed
multek/laravel-customer-engagementdependency,OneSignalDriver, and driver auto-registration — consumers needing the driver architecture stay on^1.1 - Identity fields (email/phone/name) are no longer copied into data tags; email/phone become native Email/SMS subscriptions instead
- Manager methods return
null/[]when the package is disabled (ONESIGNAL_ENABLED=falseor empty app_id) syncToOneSignalAsync()dispatches nothing when disabled
Added
- Enabled/disabled gate (zero keys, zero HTTP calls in local/test)
ONESIGNAL_TRACK_EVENTSguard (Free plan rejects custom events with 403)- Single-call
createUserupsert sync — proven against the live API (no subscription duplication on re-sync) HasOneSignalv2 trait: email/phone (E.164-validated), language/timezone/country gettersphp artisan onesignal:backfill {--dry-run} {--chunk=250}- Env-gated live smoke suite (
tests/Live/)
See UPGRADE.md for the full v1 → v2 migration guide.
🤖 Generated with Claude Code
v1.1.0
Added
- The engagement driver maps the
CustomerDTO'slanguage,timezoneandcountryfields (first-class inlaravel-customer-engagementv1.1) to OneSignal's native user properties — never to data tags, which are plan-limited (#3). OneSignalManager::updateUser($externalId, $tags, $properties)and an optional$propertiesargument oncreateUser()(language,timezone_id,country).
Changed
- Requires
multek/laravel-customer-engagement^1.1.
Full Changelog: v1.0.1...v1.1.0
v1.0.1
Fixed
updateUserTags()now sends the correctUpdateUserRequestbody toDefaultApi::updateUser— v1.0.0 sent aUsermodel, which OneSignal ignored, producing users with no data tags (#1).updateUserTags()/removeUserTags()return type corrected toPropertiesBody(wasUser, throwing aTypeErroreven on success).
Upgrade
composer update multek/laravel-onesignalThen re-run your user sync backfill (idempotent) so existing users get their tags applied.
Full Changelog: v1.0.0...v1.0.1