<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Facades\App\Repository\Setting;

class SettingServiceProvider extends ServiceProvider {

    /**
     * Register services.
     *
     * @return void
     */
    public function register() {
        //
    }

    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot() {

        \View::share('fax', Setting::all('fax'));
        \View::share('cell', Setting::all('cell'));
        \View::share('email', Setting::all('email'));
        \View::share('facebook', Setting::all('facebook'));
        \View::share('twitter', Setting::all('twitter'));
        \View::share('linkedin', Setting::all('linkedin'));
        \View::share('instagram', Setting::all('instagram'));
        \View::share('pinterest', Setting::all('pinterest'));
        \View::share('youtube', Setting::all('youtube'));
        \View::share('footer', Setting::all('front_footer_title'));
        \View::share('address', Setting::all('office_address'));
        \View::share('timing', Setting::all('office_timing'));

        $env = env("APP_ENV");

        if ($env == "local") {
            \View::share('stripe_pk', Setting::all('stripe_pk_test'));
            \View::share('stripe_sk', Setting::all('stripe_sk_test'));
        } else {
            \View::share('stripe_pk', Setting::all('stripe_pk_live'));
            \View::share('stripe_sk', Setting::all('stripe_sk_live'));
        }
    }

}
