Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Wireguard Bundle

Wireguard Bundle Laravel Package

dimkinthepro/wireguard-bundle

Laravel bundle for managing WireGuard configuration and operations in PHP. Provides integration utilities to generate and handle VPN keys, peers, and configs, helping you automate WireGuard setup and provisioning from your Laravel apps.

View on GitHub
Deep Wiki
Context7

Wireguard bundle for Symfony

Frequently asked questions about Wireguard Bundle
Can I use this bundle directly in Laravel, or is it only for Symfony?
This bundle is designed for Symfony but can be adapted to Laravel with minimal effort. You’ll need to create a Laravel ServiceProvider to register the bundle’s services and translate Symfony-specific container calls to Laravel’s `app()` or `make()` methods. The core WireGuard logic (key generation, peer management) will work unchanged.
How do I install and set up this bundle in a Laravel project?
Run `composer require dimkinthepro/wireguard-bundle`, then create a Laravel ServiceProvider to load the bundle. Override Symfony’s `ContainerInterface` with Laravel’s container and publish the bundle’s config (if any) using `php artisan vendor:publish`. Check for CLI dependencies like `wg` and ensure they’re available in your environment.
Does this bundle support generating WireGuard keys and configurations programmatically?
Yes, the bundle provides utilities to generate WireGuard keys (private/public) and create peer configurations. You can use facades or services like `Wireguard::generateKey()` or `Wireguard::addPeer()` to automate tunnel setup. Configurations are typically validated against WireGuard’s schema before application.
Will this work with Laravel’s service container and dependency injection?
The bundle assumes Symfony’s container, but you can integrate it with Laravel by wrapping its services in a decorator or facade. Bind the bundle’s services in your Laravel ServiceProvider’s `register()` method and resolve them with `app('wireguard')`. For complex dependencies, consider using Laravel’s `bind()` method to map Symfony interfaces to Laravel implementations.
Are there any Laravel-specific features, like Artisan commands or Blade directives?
The bundle itself doesn’t include Laravel-specific features, but you can extend it by publishing its assets (via `php artisan vendor:publish --tag=all`) and adding Artisan commands or Blade directives in your own package. Check the published config files for hooks or events you can leverage.
How do I handle WireGuard configurations in Laravel’s database or storage?
The bundle doesn’t enforce a storage method, so you can save configurations to Laravel’s database (e.g., using Eloquent models) or files. For database storage, create a migration for WireGuard configs and use Laravel’s query builder to fetch/update them. If the bundle expects Symfony’s Doctrine, replace it with Laravel’s database layer.
Does this bundle work with Laravel’s event system for peer/key changes?
Yes, the bundle’s event system is compatible with Laravel. You’ll need to rebind its event listeners to use Laravel’s `Event` facade or extend the bundle’s event classes. For example, listen for `PeerAddedEvent` using Laravel’s `event()` helper or `Listen` trait in your service classes.
What Laravel versions and PHP versions are supported?
The bundle targets Symfony 5.x/6.x, which aligns with Laravel 8+ (PHP 7.4+) or Laravel 9+ (PHP 8.0+). Test thoroughly with your Laravel version, as Symfony’s DependencyInjection or ContainerInterface may require polyfills. Check the bundle’s `composer.json` for PHP version constraints.
Are there alternatives to this bundle for Laravel WireGuard integration?
For Laravel, consider standalone PHP libraries like `wireguard-php` or `spatie/laravel-wireguard` (if available) for lighter integrations. If you need full bundle features, this package is the closest match, but you may need to adapt it. For CLI-focused tools, use WireGuard’s `wg` command directly via Laravel’s `Process` facade.
How do I handle WireGuard CLI dependencies (e.g., `wg`, `ip`) in production?
Ensure the `wg` and `ip` commands are installed on your production servers. Use Laravel’s `Process` facade to execute these commands cross-platform (e.g., `Process::run('wg show')`). Avoid hardcoding paths; let the bundle or your wrapper handle environment-specific CLI locations. Test CLI interactions in a CI pipeline to catch missing dependencies early.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed