G
G
gimade2016-08-11 19:54:36
Laravel
gimade, 2016-08-11 19:54:36

How to find out the list of methods?

In general, I study Laravel and then I realized that in my IDE (by pressing ctrl + space) the entire list of class methods is not displayed. So the question is, how can I find out all the methods of a class, including the fact that it inherited from 100500 classes? If not for the video, I would not have learned soon that such methods exist, hehe.
For example, here is a small piece of code:
ModelArticle is inherited from Model. (Laravel framework)
$articles = ModelArticle::latest()->get();
So the IDE knows nothing about the latest() method! What to do, how to be? :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JhaoDa, 2016-08-11
@gimade

You need to install ide-helper and inherit models from \Eloquent, not from \Illuminate\Database\Eloquent\Model, then the IDE will see more methods (but still not all).

V
Vyacheslav Plisko, 2016-08-12
@AmdY

Instead of using facades, use the wonderful DI
public function fooAction(ModelArticle $modelArticles) {
return $modelArticles->latest();
}
Well, latest is not done through stupid scopes, but by the normal method of the model.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question