Laravel $auth 调用函数作为 $auth->functionname 而不是 $auth->function()

Laravel $auth calling function as $auth->functionname rather than $auth->function()

我在 Laravel 中看到了一些代码,其中在扩展 Authenticable class 的用户模型中定义了一个函数。该函数通过 $auth 在视图中调用,如下所示:
$auth->function_name
为什么这样称呼而不是这样称呼:
$auth->function_name()

迭代相关模型时,函数作为 属性.
访问 我在 laravel 文档中找到了解决方案:
https://laravel.com/docs/5.6/eloquent-relationships#relationship-methods-vs-dynamic-properties