$this->response 和 $this->response () 的区别?
我们知道,在使用model模型获取数据的时候,$user->topics 返回的是数据集合, $user->topics()返回的是数据库查询语句。$user->topics == $user->topics()->get()。
所以想问问,这里的 $this->response 和 $this->response() 有什么区别?
我猜你是想问 Dingo Api 这个库的 API 吧,在 Controller 中引入它的 Heplers Trait,先看看它的源码,其拥有 response() 的 API,所以 $this->response() 调用很清晰,那么针对 $this->response, 你可以看看 Trait 里面的 __get() 魔术方法的重写
代码写得很清楚了,如果不知道魔术方法的作用先行去了解,所以? :confused: