<?php

namespace App\Providers;

use App\Services\PowerDNSService;
use Illuminate\Support\ServiceProvider;

class PowerDNSServiceProvider extends ServiceProvider
{
    /**
     * Register services.
     */
    public function register(): void
    {
        $this->app->singleton(PowerDNSService::class, function ($app) {
            return new PowerDNSService();
        });

        // Config dosyasını merge et
        $this->mergeConfigFrom(
            config_path('powerdns.php'),
            'powerdns'
        );
    }

    /**
     * Bootstrap services.
     */
    public function boot(): void
    {
        // Config dosyasını publish et
        $this->publishes([
            __DIR__ . '/../../config/powerdns.php' => config_path('powerdns.php'),
        ], 'powerdns-config');
    }
}
