<?php

namespace App\Providers;

use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;

use App\Models\SiteSetting;
use Illuminate\Support\Facades\View;

class AppServiceProvider extends ServiceProvider
{
    public function register()
    {
        //
    }

    public function boot()
    {
        Schema::defaultStringLength(191);

        if (Schema::hasTable('site_settings')) {
            $settings = SiteSetting::all()->pluck('value', 'key');
            View::share('siteSettings', $settings);
        }
    }
}
