pusher-http-laravel: Error Using the Facade
The error below has been reported by @alexandredes and @mottihoresh. This error occurs when using the Facade. As I’ve learned, using dependency injection it works.
call_user_func_array() expects parameter 1 to be a valid callback
I’ve tried this in my local setup, using Homestead, with both the Facade and dependency injection without any problems. The events gets registered in the console at http://pusher.com. Example code below.
<?php namespace App\Http\Controllers;
use Vinkla\Pusher\Facades\Pusher;
class PushController extends Controller {
public function index()
{
dd(Pusher::trigger('my-channel', 'my-event', ['message' => 'A']));
}
}

If someone else experience this, please report it here. If you have a solution, please share it!
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 3
- Comments: 47 (19 by maintainers)
Commits related to this issue
- Update README about issue #2 — committed to pusher/pusher-http-laravel by vinkla 9 years ago
For the time being, I’ve just renamed my facade to
LaravelPusherto great success. In my controller I calluse LaravelPusher;then I can usein my function. My alias then has to become
'LaravelPusher' => 'Vinkla\Pusher\Facades\Pusher',.As mentioned above, it’s because the class and facade clash for the namespace.
@rulatir https://github.com/vinkla/pusher#installation follow the instructions this way
Installation
Require this package, with Composer, in the root directory of your project.
Add the service provider to
config/app.phpin theprovidersarray.If you want you can use the facade. Add the reference inconfig/app.phpto your aliases array.If you prefer to use dependency injection over facades like me, then you can inject the manager:
@luismfonseca let me know if there is anything I can help with. Please let me know before you push the new version. Then I can help you test it out.
Yes, but you need to release it as a new major version. It is a breaking change. Shouldn’t be a problem though since integers are cheap.