elasticsearch
elasticsearch copied to clipboard
Class starts_with not found
Class starts_with not found in src/ElasticsearchServiceProvider.php
You can replace it by str_starts_with()
Your code is:
`if(version_compare($this->app->version(), '5.1', ">=") or starts_with($this->app->version(), "Lumen")) {
if ($this->app->runningInConsole()) {
// Registering commands
$this->commands([
ListIndicesCommand::class,
CreateIndexCommand::class,
UpdateIndexCommand::class,
DropIndexCommand::class,
ReindexCommand::class
]);
}
}`
Your new code should be:
`if(version_compare($this->app->version(), '5.1', ">=") or str_starts_with($this->app->version(), "Lumen")) {
if ($this->app->runningInConsole()) {
// Registering commands
$this->commands([
ListIndicesCommand::class,
CreateIndexCommand::class,
UpdateIndexCommand::class,
DropIndexCommand::class,
ReindexCommand::class
]);
}
}`
Link to the problematic line: https://github.com/basemkhirat/elasticsearch/blob/33ea95c730b35a3f29f4ba5c1ea2e2104b3eeb1a/src/ElasticsearchServiceProvider.php#L93