hocza / sendy-laravel

A service provider for Sendy API in Laravel 5
https://hocza.com/packages/sendy/
MIT License
71 stars 21 forks source link

Compatibility laravel 4 #10

Closed hrbarz closed 8 years ago

hrbarz commented 8 years ago

Change method boot() in Hocza\Sendy\SendyServiceProvider


    public function boot()
    {
        $app = $this->app;

        if (version_compare($app::VERSION, '5.0') < 0) {

            $this->package('hocza/sendy', 'sendy');

            // Register for exception handling
            $app->error(function (\Exception $exception) use ($app) {
                if ('Symfony\Component\Debug\Exception\FatalErrorException'
                    !== get_class($exception)
                ) {
                    $app['sendy']->notifyException($exception, null, "error");
                }
            });

            // Register for fatal error handling
            $app->fatal(function ($exception) use ($app) {
                $app['sendy']->notifyException($exception, null, "error");
            });
        } else {
          $this->publishes(array(
            __DIR__ . '/../config/sendy.php' => config_path('sendy.php')
          ));
        }

    }

thank you!

hocza commented 8 years ago

Is it a correct way to support L4?