Jump to content

PhpStorm + L5.4

Joveice

As I'm new to Laravel I have no clue what this is.

So this is my code

This works, no issues or erros (that show up or stops something from working that is)

 

I'm using barryvdh/laravel-ide-helper but I think it might be setup wrong see 

 

 

But my IDE (PhpStorm) throws this.

 

ApiToken::where('token', $token)->exists()

"Non-static method 'where' should not be called statically" "Dynamic class method called as static."

 

ApiToken::insert(
	['token' => $token]
);

"Non-static method 'where' should not be called statically" "Dynamic class method called as static."

    /**
     * create a API Token
     */
    public function createApiToken()
    {
        $token = str_random(30);
        if (!ApiToken::where('token', $token)->exists()) {
            ApiToken::insert(
                ['token' => $token]
            );
        }
    }

 

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×