0
In the Phpstorm interface is displayed a warning message stating that I am calling the orderby method in a static way, however, this is not static. My call:
Artigo::orderBy('edicao', 'desc')->paginate(25);
Would that be "wrong"? Or would I have to do:
(new Artigo)->orderBy('edicao', 'desc')->paginate(25);
Note: I am using Laravel 5.6
To access a method or object field, you should use the arrow operator
->
I just saw the scope resolution operator::
being used to determine methods and Class/static fields in php– Jefferson Quesado
This is called Facade gives a search in Laravel’s documentation
– novic
https://laravel.com/docs/5.6/facades of a read and ignore Phpstorm message it is not a problem to use the first shape
– novic
I took a look at large projects, it is normal/common this approach from what I could observe.
– Fábio Jânio
No problem, the first form is correct yes.
– arllondias