<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use App\Channels\CustomPushChannel;
use App\Models\Setting;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\View;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        //
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        Notification::extend('customPush', function ($app) {
            return new CustomPushChannel();
        });

        View::composer('*', function ($view) {
            $siteSetting = Setting::first();
            $view->with('siteSetting', $siteSetting);
        });
    }
}
