Laravel Expo Notification Channel

Expo push-notification channel for delivering notifications to React Native apps from Laravel.

Library
Composer
v2.4.0
69 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
45 /100 Fair
Development Activity 36
Maintenance 24
Community 44
Maturity 56
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
77 /100 Good
Architecture 80
Code Quality 84
Innovation 62
Learning Curve 82

Laravel Expo Notification Channel is a driver for Laravel’s notification system that sends push notifications through Expo’s push service to React Native applications. It plugs into the framework’s Notification classes so you can deliver mobile push messages the same way you send mail or database notifications.

The package provides a typed ExpoMessage builder, an ExpoPushToken value object with validation rules and an Eloquent cast, and a Guzzle-backed gateway that talks to the Expo API, including optional access-token security and delivery-receipt handling.

What You Get

  • An ExpoChannel that integrates with Laravel’s notification system via a toExpo method
  • A fluent, typed ExpoMessage builder for titles, bodies, data, sound, badges, and priority
  • An ExpoPushToken value object with a validation rule and an Eloquent cast
  • A Guzzle-based gateway with optional Expo access-token security and gzip payload compression
  • Delivery-receipt retrieval and a ExpoNotificationSent event

Common Use Cases

  • Sending push notifications to a React Native app built with Expo
  • Notifying mobile users of events alongside mail and database channels
  • Validating and storing Expo push tokens on user models
  • Tracking push delivery via Expo receipts

Under The Hood

Architecture - src/ExpoServiceProvider.php registers the driver so Laravel’s notification manager resolves an expo channel to src/ExpoChannel.php. The channel pulls an ExpoMessage (a typed builder) and the recipient’s ExpoPushToken, then hands an ExpoEnvelope to a Gateway/ExpoGateway implementation (ExpoGatewayUsingGuzzle) that POSTs to Expo’s push API and parses an ExpoResponse/ExpoError. Tokens are validated via Validation/ExpoPushTokenRule and can be stored through the Casts/AsExpoPushToken Eloquent cast; delivery emits an Events/ExpoNotificationSent event.

Tech Stack - PHP 8.3+, GuzzleHttp 7 for transport, and the illuminate/notifications, illuminate/contracts, and illuminate/support components (Laravel 12/13). Optional ext-zlib enables gzip compression of payloads over 1 KiB.

Code Quality - The project is strongly typed and well-tested, using Larastan (level static analysis), Laravel Pint, and a PHPUnit suite via Orchestra Testbench. Value objects and dedicated exception types (CouldNotSendNotification, CouldNotGetReceipts) make failures explicit.

API Design - Usage follows Laravel’s notification idioms exactly: implement toExpo() returning a fluent ExpoMessage, expose a routeNotificationForExpo() on the notifiable, and the channel handles batching and transport. The abstractions are clean and require minimal boilerplate.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers