<?php

namespace Rymanalu\LaravelCircuitBreaker;

use Illuminate\Support\ServiceProvider;

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

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton(CircuitBreaker::class, function ($app) {
            return new CircuitBreaker($app['cache']->store());
        });
    }

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

<?php

namespace Rymanalu\LaravelCircuitBreaker;

use Illuminate\Support\ServiceProvider;

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

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->singleton(CircuitBreaker::class, function ($app) {
            return new CircuitBreaker($app['cache.store']);
        });
    }

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

--- 
+++ 
@@ -21,7 +21,7 @@
     public function register()
     {
         $this->app->singleton(CircuitBreaker::class, function ($app) {
-            return new CircuitBreaker($app['cache.store']);
+            return new CircuitBreaker($app['cache']->store());
         });
     }
 
Fix cache.store does not exist when using in Lumen 5.1.
