<?php namespace Cornford\Bootstrapper;

use Illuminate\Support\ServiceProvider;

class BootstrapServiceProvider extends ServiceProvider {

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

	/**
	 * Bootstrap the application events.
	 *
	 * @return void
	 */
	public function boot()
	{
		$assetPath = __DIR__.'/../../../public';
		$this->publishes([$assetPath => public_path('packages/cornford/bootstrapper')], 'bootstrapper');
	}

	/**
	 * Register the service provider.
	 *
	 * @return void
	 */
	public function register()
	{
		$this->app->singleton('bootstrap', function($app)
		{
			return new Bootstrap(
				$this->app->make('Illuminate\Html\FormBuilder', ['csrfToken' => $app['session.store']->getToken()]),
				$this->app->make('Illuminate\Html\HtmlBuilder'),
				$this->app->make('Illuminate\Http\Request')
			);
		});
	}

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

}

<?php namespace Cornford\Bootstrapper;

use Illuminate\Support\ServiceProvider;

class BootstrapServiceProvider extends ServiceProvider {

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

	/**
	 * Bootstrap the application events.
	 *
	 * @return void
	 */
	public function boot()
	{
		$assetPath = __DIR__.'/../../../public';
		$this->publishes([$assetPath => public_path('packages/cornford/bootstrapper')], 'bootstrapper');
	}

	/**
	 * Register the service provider.
	 *
	 * @return void
	 */
	public function register()
	{
		$this->app['bootstrap'] = $this->app->share(function($app)
		{
			return new Bootstrap(
				$this->app->make('Illuminate\Html\FormBuilder', ['csrfToken' => $app['session.store']->getToken()]),
				$this->app->make('Illuminate\Html\HtmlBuilder'),
				$this->app->make('Illuminate\Http\Request')
			);
		});
	}

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

}

Revert "$this->app->share deprecated in 5.4"
Revert "$this->app->share deprecated in 5.4"

This reverts commit 3297ab6d4c36bbe8e15701bae370177e9bb91e81.
