thephpleague / statsd

A library for working with StatsD
MIT License
351 stars 56 forks source link

Getting a fatal error on Laravel 5.4 #39

Closed august closed 7 years ago

august commented 7 years ago

After installing, I get the following error:

PHP Fatal error: Call to undefined method Illuminate\Foundation\Application::share() in ...vendor/league/statsd/src/Laravel5/Provider/StatsdServiceProvider.php on line 46

I'm on Laravel 5.4.

marcqualie commented 7 years ago

I just pushed a new release which should resolve this issue

cvsouth commented 7 years ago

Anyone with the same error despite latest version of league/statsd, make sure you are using the Laravel5 namespace:

League\StatsD\Laravel5\Provider\StatsdServiceProvider::class VS League\StatsD\Laravel\Provider\StatsdServiceProvider::class

'Statsd' => League\Statsd\Laravel5\Facade\StatsdFacade::class VS 'Statsd' => League\Statsd\Laravel\Facade\StatsdFacade::class

It's a silly mistake but when upgrading from Laravel 4.2 to 5.2 on a project I hadn't built this was my issue. Hope it helps someone.