<?php

namespace Scriptotek\Sru\Providers;

use Illuminate\Support\ServiceProvider;
use Scriptotek\Sru\Client as SruClient;

class SruServiceProvider extends ServiceProvider
{

    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function boot()
    {
        $this->publishes(array(
            __DIR__.'/../../config/config.php' => config_path('sru.php')
        ));
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $app = $this->app;
        $this->mergeConfigFrom(
            __DIR__.'/../../config/config.php',
            'sru'
        );
        $app['sru-client'] = $app->share(function ($app) {
            return new SruClient($app['config']->get('sru.endpoint'), $app['config']->get('sru'));
        });
        $app->alias('sru-client', SruClient::class);
    }

    /**
     * Get the services provided by the provider.
     *
     * @return array
     */
    public function provides()
    {
        return array('sru-client');
    }
}

<?php

namespace Scriptotek\Sru\Providers;

use Illuminate\Support\ServiceProvider;
use Scriptotek\Sru\Client as SruClient;

class SruServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function boot()
    {
        $this->publishes(array(
            __DIR__.'/../../config/config.php' => config_path('sru.php')
        ));
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->mergeConfigFrom(
            __DIR__.'/../../config/config.php',
            'sru'
        );
        $this->app->singleton(SruClient::class, function ($app) {
            return new SruClient($app['config']->get('sru.endpoint'), $app['config']->get('sru'));
        });
    }

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

Update service provider to work with Laravel 5.4
Update service provider to work with Laravel 5.4
