jollystrix/remnawave-api-laravel

Laravel Remnawave API package

v1.0.0 2025-05-11 19:38 UTC

This package is auto-updated.

Last update: 2025-07-11 19:57:01 UTC


README

This package provides a straightforward API client for integrating your Laravel application with the Remnawave API, enabling seamless communication with the Remnawave platform. For full API documentation, visit the official Remnawave API documentation.

📦 Installation

  1. Install the package via Composer:
composer require jollystrix/remnawave-api-laravel
  1. Add the service provider to your bootstrap/providers.php file:
Jollystrix\RemnawaveApi\RemnawaveServiceProvider::class,
  1. Publish the configuration file:
php artisan vendor:publish --tag="remnawave"
  1. Configure your .env file:

Add the required environment variables to your .env file:

REMNAWAVE_API_KEY=your-api-key
REMNAWAVE_API_URL=https://remna.st

🚀 Usage

Creating an API Client Instance

To begin using the Remnawave API client, create a new instance of the Remnawave class:

use Jollystrix\RemnawaveApi\RemnawaveClient;
Route::get('/inbounds', function (RemnawaveClient $remnawave): mixed {
    $response = $remnawave->get("inbounds");

    $entry = collect($response['response']);
    return $entry;
});

Basic API Requests

The are the available methods for making requests to the Remnawave API:

$remnawave->get(string $endpoint, array $data = [], array $headers = []);
$remnawave->post(string $endpoint, array $data = [], array $headers = []);
$remnawave->put(string $endpoint, array $data = [], array $headers = []);
$remnawave->delete(string $endpoint, array $data = [], array $headers = []);
$remnawave->patch(string $endpoint, array $data = [], array $headers = []

Explanation of Parameters: string $endpoint: The API endpoint to send the request to (e.g., users, inbounds).

array $data (optional) Data to be sent with the request. For POST, PUT, and PATCH requests, this would typically contain the data to be updated or created.

array $headers (optional): Custom headers to be included with the request. You can merge them with default headers as needed.

📄 License

This package is open-source and available under the MIT license. Feel free to use and modify it as needed.