Skip to content

BadMethodCallException: Method Illuminate\Config\Repository::integer does not exist. #46

@mmleoni

Description

@mmleoni

in vendor\google-gemini-php\laravel\src\ServiceProvider.php

on line 38, the ServiceProvider calls config()->integer('gemini.request_timeout', 30), but config() returns a Config\Repository that doesn't have an integer() method. This is a package bug: the package calls config()->integer(), which doesn't exist.

Patching the vendor file to fix the bug:
on line 38: replacing config()->integer() with (int) config().

so line
->withApiKey(apiKey: $apiKey)
->withHttpClient(client: new GuzzleClient(['timeout' => config->integer('gemini.request_timeout', 30)]));

becomes
->withApiKey(apiKey: $apiKey)
->withHttpClient(client: new GuzzleClient(['timeout' => (int) config('gemini.request_timeout', 30)]));

ps: Laravel Framework 10.49.1

bye,
marco

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions