php-telegram-bot / laravel

Laravel package for PHP Telegram Bot Library
Other
171 stars 51 forks source link

Not working in Lumen #6

Closed pooriamo closed 5 years ago

pooriamo commented 5 years ago

Hi. I'm getting this error in Lumen:

Argument 1 passed to PhpTelegramBot\Laravel\PhpTelegramBotServiceProvider::PhpTelegramBot\Laravel{closure}() must be an instance of Illuminate\Contracts\Foundation\Application, instance of Laravel\Lumen\Application given, called in /vendor/illuminate/container/Container.php on line 776 in /vendor/php-telegram-bot/laravel/src/Laravel/PhpTelegramBotServiceProvider.php:55

pooriamo commented 5 years ago

I replaced the type-hint and it's working. But it's a change in the source code. Is there any other solutions for this?

/**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind(PhpTelegramBotContract::class, function () {
            $app = app();
akalongman commented 5 years ago

@pooriamo I'll fix that in next release

akalongman commented 5 years ago

Fixed in 1.0.1 version