jollystrix / remnawave-api-laravel
Laravel Remnawave API package
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:lirary
Requires
- guzzlehttp/guzzle: ^7.9
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
- Install the package via Composer:
composer require jollystrix/remnawave-api-laravel
- Add the service provider to your bootstrap/providers.php file:
Jollystrix\RemnawaveApi\RemnawaveServiceProvider::class,
- Publish the configuration file:
php artisan vendor:publish --tag="remnawave"
- 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.