有没有任何方法/方法可以找出laravel中某个类的所有函数


Is there any method/way to find out all the functions of some class in laravel?

我了解Laravel(5.1版本,尽管最近才有5.2版本)框架。。。并深入研究。。。我想问的是,让我通过一些例子来详细说明:
我创建了名为Blog:的模型

namespace App; 
use Illuminate'Database'Eloquent'Model;
class Blog extends Model {
protected $fillable = ['title','body'];
}

现在,在我的控制器中,我正在访问我的控制器store()方法中此类的函数create(),如:
public function store(BlogRequest $request) { $input = Request::all(); Blog::create($input); return redirect('blogs'); }
如您所见,在上面的控制器方法中,我们正在访问静态函数/方法create(),即
Blog::create($input)
。。所以问题是,还有很多其他方法存在,比如模型(博客)类的create()方法,它扩展了model类。。。有没有任何方法/策略/功能可以找到/知道这个模型类的所有功能。。。

是!您可以参考API文档。

例如,我搜索了model,找到了Illuminate''Database''Eloquent''model,这是您的模型扩展的类,它是create-static方法。

您可以在左上角更改Laravel版本,并在右上角筛选类、名称空间、接口和特征。非常整洁!

编辑:

您可以在ReflectionClass上使用getMethods方法来列出给定类的所有可用方法。

例如:

$methods = (new ReflectionClass(''App'Blog'))->getMethods();
dd($methods);