<?php

namespace App\Providers;

use App\Models\News;
use App\Observers\NewsObserver;
use App\View\Composers\AdminLayoutComposer;
use App\View\Composers\CmsVersionComposer;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;

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

    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        View::composer('layouts.admin', AdminLayoutComposer::class);
        View::composer(['layouts.admin', 'layouts.app'], CmsVersionComposer::class);
        News::observe(NewsObserver::class);
    }
}
