Download the PHP package spits-online/laravel-openprovider-api without Composer
On this page you can find all versions of the php package spits-online/laravel-openprovider-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spits-online/laravel-openprovider-api
More information about spits-online/laravel-openprovider-api
Files in spits-online/laravel-openprovider-api
Package laravel-openprovider-api
Short Description This is my package laravel-openprovider-api
License MIT
Homepage https://github.com/Spits-online/laravel-openprovider-api
Informations about the package laravel-openprovider-api
openprovider.com API Support for Laravel
- Introduction
- Why This Package?
- Installation
- Prerequisites
- Step-by-Step Installation
- Configuration
- Usage
- 1. Contact Management
- Retrieve Contacts
- Retrieve a Single Contact
- Create or Update Contacts
- Delete Contacts
- Contact Model Overview
- 2. Sending Notifications
- Supported Notification Channels
- Example: Sending SMS Notifications
- 1. Contact Management
- Exception Handling
- Contributing
- License
- Contact
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 and Openprovider seamless and efficient.
Installation
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
-
Add the package to your Laravel project using Composer:
- Once installed, the package will automatically register the
LarvelOpenproviderApiServiceProvider
using Laravel's package auto-discovery. -
Run the following command to publish the package configuration:
This will create a
config/openprovider-api.php
file in your application.
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
.
For detailed configuration options, refer to the comments within the config/openprovider-api.php file.
Usage
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
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.
Parameters:
options
: An array of options for the request see the Openprovider docs for the available options.
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.
Parameters:
id
: The id of the 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.
Parameters:
id
: TheID
of the domain you wish to updatedata
: The data you wish to update. See the Openprovider docs for the updatable attributes
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
You can get the records by using the show
function in DnsRecordsController.
Parameters:
domain
: The domain for which you want to see de DNS zone informationoptions
: An array set as query param with all the options you want to send with the call. See the docs for available options
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
Exporting records
We created the export
function in Spits\LaravelOpenproviderApi\Http\Controllers\DnsRecordsController
to export Dns zone records to an .xlsx file.
Contributing
Please submit ideas, issues and pull requests to the GitHub repository.
License
This package is open-sourced software licensed under the MIT license.
Contact
For any inquiries or support, please contact Spits.
All versions of laravel-openprovider-api with dependencies
spatie/laravel-package-tools Version ^1.16
maatwebsite/excel Version ^3.1