PhpStorm: {Model} and HasTimestamps define the same property timestamps (Laravel)

Viewed 3695

PhpStorm version 2020.3 shows an error on $timestamps property in my Laravel model:

{Model} and HasTimestamps define the same property timestamps

enter image description here

5 Answers

This is a bug and it's introduced in the new version of PhpStorm.

It's not possible to disable the warning since it's an annotator inspection. I also don't recommend changing your code for the sole purpose of fixing this warning since it's an IDE bug and will be addressed in their next patch. If it's not really causing any breaking side effects, just wait until the patch is released!


Update

This bug has been fixed in PhpStorm 2020.3.1.

It seems like a PHPStorm bug.

If it bothers you, you can change public $timestamps = false; to

public function usesTimestamps() : bool{
    return false;
}

This is a PhpStorm bug, I fixed with define as property on class phpdoc.

Like this:

Php storm bug fix

Also you can update your PhpStorm.

Very simple, add (bool) or (boolean), look: public $timestamps = (boolean) false;

Related