<?php namespace App\Providers;

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

class SettingsServiceProvider extends ServiceProvider
{
    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = true;

    /**
     * Register bindings in the container.
     *
     * @return void
     */
    public function register()
    {
        define('IS_DEMO', (gethostname() === 'BeDrive' ? 1 : 0));

        $this->app->singleton('Settings', function () {
            return new \App\Services\Settings(new Setting());
        });
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return ['Settings'];
    }
}