-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use object of type Algolia\\AlgoliaSearch\\Config\\SearchConfig as array #881
Comments
To fix this, we can use the methods provided by the SearchConfig object to access its properties, assuming they are accessible through methods or public properties. Here’s how you might approach it: Inspect the SearchConfig object: Check which methods or properties are available. You can do this by running dd(get_class_methods($config)); to see the available methods or dd($config); to see its properties. Replace array-style access with method calls: If, for example, getConnectTimeout() is a method of SearchConfig, you would replace $config['connect_timeout'] with $config->getConnectTimeout(). |
Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! |
Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! |
Fixed via #884 |
Scout Version
10.11.6
Scout Driver
Algolia
Laravel Version
11
PHP Version
8.2
Database Driver & Version
No response
SDK Version
No response
Meilisearch CLI Version
No response
Description
After insert in model with Searchable trait i receveid thir error
"message": "Cannot use object of type Algolia\\AlgoliaSearch\\Config\\SearchConfig as array", "exception": "Error", "file": "/Users/brocard/Projects/VALLARTA/AppKovayVacations/AppKovayApi/vendor/laravel/scout/src/Engines/Algolia3Engine.php", "line": 42,
Steps To Reproduce
Just after insert using the model with the trait or run the command
php artisan scout:import Model Namespace
The text was updated successfully, but these errors were encountered: