Download the PHP package jeffersongoncalves/laravel-beehiiv without Composer
On this page you can find all versions of the php package jeffersongoncalves/laravel-beehiiv. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeffersongoncalves/laravel-beehiiv
More information about jeffersongoncalves/laravel-beehiiv
Files in jeffersongoncalves/laravel-beehiiv
Package laravel-beehiiv
Short Description PHP/Laravel client for the Beehiiv REST API v2: publications, subscriptions, posts, segments, automations and referral programs.
License MIT
Homepage https://github.com/jeffersongoncalves/laravel-beehiiv
Informations about the package laravel-beehiiv
Laravel Beehiiv
A PHP/Laravel client for the Beehiiv REST API v2. Covers publications, subscriptions, posts, segments, automations and referral programs through a simple, typed API built on Laravel's Http client.
Features
- Publications: list, get
- Subscriptions: list, get, create, update, delete
- Posts: list, get, create, delete
- Segments: list, get
- Automations: list, get
- Referral Program: get
- Optional default publication scope (via config) so you don't have to pass a publication ID to every call
- Throws
BeehiivException(with the original API error body) on any non-2xx response - Throws
InvalidArgumentExceptionbefore hitting the API when a required field/argument is missing
Installation
You can install the package via composer:
Publish the config file:
Set your Beehiiv credentials in .env:
Both values are found under Settings > Integrations > API in your Beehiiv account. BEEHIIV_PUBLICATION_ID is optional — set it if most of your calls target a single publication, otherwise pass a publication ID explicitly to each method.
Configuration
Usage
The package is resolved via the Beehiiv facade or by injecting JeffersonGoncalves\Beehiiv\Beehiiv. Each resource is exposed as a method returning a dedicated resource class.
Publications
Publications are not scoped to a publication ID — this resource lists your publications and looks one up:
Subscriptions
Every other resource is scoped to a publication. Pass $publicationId explicitly, or omit it to use beehiiv.publication_id from config:
Posts
Segments, Automations and Referral Program
Error handling
Any non-2xx API response throws JeffersonGoncalves\Beehiiv\Exceptions\BeehiivException, which exposes the decoded error body:
Missing required fields/arguments (e.g. email on subscriptions()->create(), title on posts()->create(), or a publication ID when none is configured) throw InvalidArgumentException before any HTTP call is made.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Jefferson Gonçalves
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-beehiiv with dependencies
illuminate/http Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
spatie/laravel-package-tools Version ^1.14.0