Skip to content
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

Class starts_with not found #121

Open
saguajardo opened this issue Dec 29, 2020 · 1 comment
Open

Class starts_with not found #121

saguajardo opened this issue Dec 29, 2020 · 1 comment

Comments

@saguajardo
Copy link

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
    ]);

}

}`

@tintamarre
Copy link

Link to the problematic line:

if(version_compare($this->app->version(), '5.1', ">=") or starts_with($this->app->version(), "Lumen")) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants