Laravel 在 Blade 中读取 table 和 [] 值

Laravel read a table with [] values in Blade

我正在尝试读取名为 class[] 的 table 的内容,如下图所示

我负责读取内容的代码如下

我得到的错误如下所示

任何知道我如何解决这个问题的人。

发生这种情况是因为 php 世界中的 [] 是为数组指定的,所以您可以尝试 $var['class[]']

$var->getAttribute('class[]')