当我尝试使用 $student->links() 我看到这个错误:
Facade\Ignition\Exceptions\ViewException Call to undefined method App\Student::links()
我检查了 Controller 、型号等,但它们看起来都还可以……我该如何解决这个问题?
(我在我的 Macbook 和 VPS -CentOS7 上都试过这个代码,但同样的问题发生了)
我的那部分观点如下所示:
</tr>
@endforeach
</tbody>
</table>
{{ $student->links() }}
</div>
@endsection
最佳答案
改变
{{ $student->links() }}
至
{{ $students->links() }}
(使用复数形式)。
关于php - 当我尝试使用 links() 时调用未定义的方法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59121960/