PHPackages                             spits-online/laravel-openprovider-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. spits-online/laravel-openprovider-api

ActiveLibrary[API Development](/categories/api)

spits-online/laravel-openprovider-api
=====================================

This is my package laravel-openprovider-api

1.0.1(2mo ago)016[3 PRs](https://github.com/Spits-online/laravel-openprovider-api/pulls)MITPHPPHP ^8.2||^8.3||^8.4||^8.5CI passing

Since May 22Pushed 2mo agoCompare

[ Source](https://github.com/Spits-online/laravel-openprovider-api)[ Packagist](https://packagist.org/packages/spits-online/laravel-openprovider-api)[ Docs](https://github.com/Spits-online/laravel-openprovider-api)[ GitHub Sponsors](https://github.com/Spits)[ RSS](/packages/spits-online-laravel-openprovider-api/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (23)Versions (12)Used By (0)

openprovider.com API Support for Laravel
========================================

[](#openprovidercom-api-support-for-laravel)

1. [Introduction](#overview)
    - [Why This Package?](#why-this-package)
2. [Installation](#installation)
    - [Prerequisites](#prerequisites)
    - [Step-by-Step Installation](#step-by-step-installation)
3. [Configuration](#configuration)
4. [Usage](#usage)
    - [1. Contact Management](#1-contact-management)
        - [Retrieve Contacts](#retrieve-contacts)
        - [Retrieve a Single Contact](#retrieving-a-single-contact)
        - [Create or Update Contacts](#create-or-update-contacts)
        - [Delete Contacts](#delete-contacts)
        - [Contact Model Overview](#contact-model-overview)
    - [2. Sending Notifications](#2-sending-notifications)
        - [Supported Notification Channels](#supported-notification-channels)
        - [Example: Sending SMS Notifications](#example-sending-sms-notifications)
5. [Exception Handling](#exception-handling)
6. [Contributing](#contributing)
7. [License](#license)
8. [Contact](#contact)

Overview
--------

[](#overview)

The Laravel Openprovider package simplifies integrating the powerful Openprovider API into your Laravel applications. It provides a user-friendly way to manage Domains and DNS Zone records. This package is designed to make communication between [Laravel](https://laravel.com) and [Openprovider](https://www.openprovider.com/) seamless and efficient.

Installation
------------

[](#installation)

### Prerequisites

[](#prerequisites)

Before installing this package, ensure your system meets the following requirements:

- **PHP**: Version `^8.3`
- **Laravel**: Version `^11.0`, `^12.0`
- **Openprovider Account**

### Step-by-Step Installation

[](#step-by-step-installation)

1. Add the package to your Laravel project using Composer: ```
    composer require spits-online/laravel-openprovider-api
    ```
2. Once installed, the package will automatically register the `LarvelOpenproviderApiServiceProvider` using Laravel's package auto-discovery.
3. Run the following command to publish the package configuration: ```
    php artisan vendor:publish --tag="laravel-openprovider-api-config"
    ```

    This will create a `config/openprovider-api.php` file in your application.

Configuration
-------------

[](#configuration)

OPENPROVIDER\_USERNAME="{{username}}" OPENPROVIDER\_PASSWORD="{{password}}"

The `config/openprovider-api.php` file contains all configurable options, including:

- Openprovider base URL: the API URL for openprovider `OPENPROVIDER_BASE_URL` most likely `"https://api.openprovider.eu/v1beta"`
- Server IP: Set the IP address of your server to communicate with the API `OPENPROVIDER_IP`
- Openprovider username: Set the username of your account (must have permission to use API, can be set in Openprovider dashboard) `OPENPROVIDER_USERNAME`.
- Openprovider password: Set the password of your account (must have permission to use API, can be set in Openprovider dashboard) `OPENPROVIDER_PASSWORD`.

    ```
    OPENPROVIDER_BASE_URL="https://api.openprovider.eu/v1beta"
    OPENPROVIDER_IP={IP address of your server}
    OPENPROVIDER_USERNAME={Openprovider username}
    OPENPROVIDER_PASSWORD={Openprovider password}
    ```

For detailed configuration options, refer to the comments within the config/openprovider-api.php file.

Usage
-----

[](#usage)

### 1. Domain management

[](#1-domain-management)

This package provides functionality for managing domains via the Openprovider API. Below are the key actions you can perform with the `DomainService`.

#### Retrieve a list of domains

[](#retrieve-a-list-of-domains)

You can retrieve a list of domain using the `getDomains()` method. To be able to retrieve the domains, make sure you have specified the credentials in your `.env` file.

```
use Spits\LaravelOpenproviderApi\Services\DomainService;

$domains = app(new DomainService())->index(options: ['limit' => 100, 'offset' => 100]);
```

Parameters:

- `options`: An array of options for the request see the [Openprovider docs](https://docs.openprovider.com/doc/all#operation/ListDomains) for the available options.

#### Retrieving a single domain

[](#retrieving-a-single-domain)

You can also retrieve a single domain using the `getDomain()` method. This allows you to get only one domain by specifying its id.

```
use Spits\LaravelOpenproviderApi\Services\DomainService;

$domain = app(new DomainService())->getDomain(id: 'Openprovider ID');
```

Parameters:

- `id`: The id of the domain

#### Update domain

[](#update-domain)

You can update a domain by passing the `id` and `data` array to the `updateDomain` method.
This method requires the domain's identifier.

```
use Spits\LaravelOpenproviderApi\Services\DomainService;

$response = new DomainService()->updateDomain(id: 'id', data: []);
```

Parameters:

- `id`: The `ID` of the domain you wish to update
- `data`: The data you wish to update. See the [Openprovider docs](https://docs.openprovider.com/doc/all#operation/UpdateDomain) for the updatable attributes

### 2. Managing DNS zones

[](#2-managing-dns-zones)

This package supports managing DNS zones.
We made specific controllers for the Dns zone records as its our own main use case.
But the DnsService class can be used for all functions related to DNS zones.

#### Retrieving DNS zone records

[](#retrieving-dns-zone-records)

You can get the records by using the `show` function in DnsRecordsController.

```
use Spits\LaravelOpenproviderApi\Services\DnsService;

class DnsRecordsController {
    public function show(string $domain, DnsService $service)
    {
        $options = request()->get('options', ['with_records' => 'true']);

        $response = $service->getDnsZone($domain, $options);

        return $response->collect();
    }
}
```

Parameters:

- `domain`: The domain for which you want to see de DNS zone information
- `options`: An array set as query param with all the options you want to send with the call. See the docs for available [options](https://docs.openprovider.com/doc/all#tag/ZoneService)

#### Creating / Updating / Removing records

[](#creating--updating--removing-records)

We chose too split these in separate controller functions.
But all can be done in 1 operation by calling the `updateDnsZone` function in `Spits\LaravelOpenproviderApi\Services\DnsService`

```
use Spits\LaravelOpenproviderApi\Services\DnsService;

class DnsRecordsController {
    public function store(string $domain, DnsService $service, DnsRecordStoreRequest $request)
    {
        $data = [
            'provider' => $request->validated('provider'),
            'records' => [
                'add' => [
                    $request->validated('record'),
                ],
            ],
        ];

        return $service->updateDnsZone($domain, $data);
    }
}
```

#### Exporting records

[](#exporting-records)

We created the `export` function in `Spits\LaravelOpenproviderApi\Http\Controllers\DnsRecordsController` to export Dns zone records to an .xlsx file.

```
use Spits\LaravelOpenproviderApi\Services\DnsService;

class DnsRecordsController {
    public function export(string $domain, DnsService $service)
    {
        $options = request()->get('options', ['with_records' => 'true']);

        $response = $service->getDnsZone($domain, $options);
        $data = $response->collect();
        $collection = collect($data['data']['records'])->map(function ($item) {
            return (object) $item;
        });

        $export = new DnsZoneExport($collection);

        return Excel::download($export, 'dns_zone_'.$domain.'.xlsx');
    }
}
```

Contributing
------------

[](#contributing)

Please submit ideas, issues and pull requests to the [GitHub repository](https://github.com/spits-online/laravel-openprovider-api).

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

Contact
-------

[](#contact)

For any inquiries or support, please contact [Spits](mailto:webapps@spits.online).

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance86

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~335 days

Total

2

Last Release

73d ago

PHP version history (2 changes)1.0.0PHP ^8.2|^8.3

1.0.1PHP ^8.2||^8.3||^8.4||^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/a197446050907985526250c3d9e6c37590d898a768422ebd0ec6b52ece55019f?d=identicon)[WebApps Spits](/maintainers/WebApps%20Spits)

---

Top Contributors

[![SpitsAdmin](https://avatars.githubusercontent.com/u/16835345?v=4)](https://github.com/SpitsAdmin "SpitsAdmin (6 commits)")[![WoutSpits](https://avatars.githubusercontent.com/u/122993046?v=4)](https://github.com/WoutSpits "WoutSpits (3 commits)")

---

Tags

laravelspitsopenproviderlaravel-openprovider-apiOpenprovider API

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/spits-online-laravel-openprovider-api/health.svg)

```
[![Health](https://phpackages.com/badges/spits-online-laravel-openprovider-api/health.svg)](https://phpackages.com/packages/spits-online-laravel-openprovider-api)
```

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.8k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1123.7k](/packages/codebar-ag-laravel-docuware)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
