我试着为拉威尔的模型建立一条路径
I created a function in my model:
public function path()
{
return App\Helper\GeneralController::getURL($this);
}
with dd(App\Helper\GeneralController::getURL($this))
test I got the right answer. (output is a URL)
但是考虑到电话号码:$article->path
我得到了这个错误:
App\Article:: path must return a relationship instance.
怎么啦?