src/ServiceProvider.php
public function register()
	{
		$method = version_compare(Application::VERSION, '5.2', '>=') ? 'singleton' : 'bindShared';

		// Bind the manager as a singleton on the container.
		$this->app->$method('anlutro\LaravelSettings\SettingsManager', function($app) {
			// When the class has been resolved once, make sure that settings
			// are saved when the application shuts down.
			if (version_compare(Application::VERSION, '5.0', '<')) {
				$app->shutdown(function($app) {
					$app->make('anlutro\LaravelSettings\SettingStore')->save();
				});
			}
			
			/**
			 * Construct the actual manager.
			 */
			return new SettingsManager($app);
		});

		// Provide a shortcut to the SettingStore for injecting into classes.
		$this->app->bind('anlutro\LaravelSettings\SettingStore', function($app) {
			return $app->make('anlutro\LaravelSettings\SettingsManager')->driver();
		});

		$this->app->alias('anlutro\LaravelSettings\SettingStore', 'setting');

		if (version_compare(Application::VERSION, '5.0', '>=')) {
			$this->mergeConfigFrom(__DIR__ . '/config/config.php', 'settings');
		}
	}
public function register()
	{
		$method = version_compare(Application::VERSION, '5.2', '>=') ? 'singleton' : 'bindShared';

		// Bind the manager as a singleton on the container.
		$this->app->$method('anlutro\LaravelSettings\SettingsManager', function($app) {
			// When the class has been resolved once, make sure that settings
			// are saved when the application shuts down.
			if (version_compare(Application::VERSION, '5.0', '<')) {
				$app->shutdown(function($app) {
					$app->make('anlutro\LaravelSettings\SettingStore')->save();
				});
			}
			
			/**
			 * Construct the actual manager.
			 */
			return new SettingsManager($app);
		});

		// Provide a shortcut to the SettingStore for injecting into classes.
		$this->app->bind('anlutro\LaravelSettings\SettingStore', function($app) {
			return $app->make('anlutro\LaravelSettings\SettingsManager')->driver();
		});

		$this->app->alias('anlutro\LaravelSettings\SettingStore', 'setting');

		if (version_compare(Application::VERSION, '5.0', '>=')) {
			$this->mergeConfigFrom(__DIR__ . '/config/config.php', 'settings');
		}
	}
public function register ( ) { $ method = version_compare ( Application :: VERSION , '5.2' , '>=' ) ? 'singleton' : 'bindShared' ; // Bind the manager as a singleton on the container. $ this -> app -> $ method ( 'anlutro\LaravelSettings\SettingsManager' , function ( $ app ) { // When the class has been resolved once, make sure that settings // are saved when the application shuts down. if ( version_compare ( Application :: VERSION , '5.0' , '<' ) ) { $ app -> shutdown ( function ( $ app ) { $ app -> make ( 'anlutro\LaravelSettings\SettingStore' ) -> save ( ) ; } ) ; } /**
			 * Construct the actual manager.
			 */ return new SettingsManager ( $ app ) ; } ) ; // Provide a shortcut to the SettingStore for injecting into classes. $ this -> app -> bind ( 'anlutro\LaravelSettings\SettingStore' , function ( $ app ) { return $ app -> make ( 'anlutro\LaravelSettings\SettingsManager' ) -> driver ( ) ; } ) ; $ this -> app -> alias ( 'anlutro\LaravelSettings\SettingStore' , 'setting' ) ; if ( version_compare ( Application :: VERSION , '5.0' , '>=' ) ) { $ this -> mergeConfigFrom ( __DIR__ . '/config/config.php' , 'settings' ) ; } }
Register IoC bindings.
Register IoC bindings .