Installation Run the package installer:
composer require moox/devops
php artisan mooxdevops:install
This publishes migrations, config, and sets up Filament integration.
First Use Case
/admin) to manage Forge servers.devops config file (config/devops.php) is published and configured.php artisan migrate
config/devops.php (published via vendor:publish).database/migrations/ for devops_* tables.App\Providers\MooxDevopsServiceProvider (if manually registered).Server Management via Filament
Server resource to add custom fields:
use Moox\Devops\Resources\ServerResource;
class CustomServerResource extends ServerResource {
public static function form(Form $form): Form {
return parent::form($form)
->schema([
// Add custom fields here
TextInput::make('custom_field')->required(),
]);
}
}
API Integration
Devops) or service container bindings.$servers = \Moox\Devops\Facades\Devops::servers()->get();
Event-Driven Extensions
use Moox\Devops\Events\ServerCreated;
ServerCreated::listen(function (ServerCreated $event) {
// Sync with external tools (e.g., Slack, monitoring)
});
Configuration Overrides
config/devops.php:
'forge' => [
'api_token' => env('FORGE_API_TOKEN'),
'permissions' => [
'create_servers' => true,
],
],
Moox\Devops\Tests\CreatesServers trait for server-related tests.Filament Dependency
composer require filament/filament:"^3.0"
Forge API Rate Limits
use Illuminate\Support\Facades\Http;
Http::timeout(30)->retry(3, 100);
Migration Conflicts
servers vs. forge_servers).Caching Issues
php artisan filament:cache-clear
Log Forge API Calls Enable Laravel’s HTTP logging:
'forge' => [
'debug' => env('FORGE_DEBUG', false),
],
Check logs in storage/logs/laravel.log.
Filament Debug Mode Enable for UI issues:
FILAMENT_DEBUG=true
Custom Resources
Override default Filament resources by binding them in AppServiceProvider:
public function boot(): void {
$this->app->bind(
\Moox\Devops\Resources\ServerResource::class,
\App\Resources\CustomServerResource::class
);
}
Webhook Handlers
Extend the ServerWebhookHandler class to process custom events:
namespace App\Devops;
use Moox\Devops\Handlers\ServerWebhookHandler as BaseHandler;
class CustomWebhookHandler extends BaseHandler {
public function handleServerUpdated($payload) {
// Custom logic
}
}
Service Container
Bind custom services to the devops container:
$this->app->extend('devops', function ($devops) {
$devops->extend('backup', function () {
return new CustomBackupService();
});
});
FORGE_API_TOKEN and FORGE_SITE_URL are set in .env:
FORGE_API_TOKEN=your_token_here
FORGE_SITE_URL=https://forge.example.com
config/devops.php:
'permissions' => [
'view_servers' => true,
'manage_servers' => false, // Disable by default
],
How can I help you explore Laravel packages today?