如果您想要任何其他代码段,我的代码在这里,我也会提供那段代码
<div class="panel-heading ">Organization Profile</div>
<table class="table table-striped">
<thead>
<tr>
<th>Attributes</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td>Org Name</td>
<td>{{$org->name}}</td>
</tr>
<tr>
<td>Owner Name</td>
<td>{{$org->owner}}</td>
</tr>
</tbody>
</table>
</div>
Trying to get property of non-object
当您返回数组但尝试在刀片文件中使用对象或根本不传递正确的对象字符串时,问题通常出现在 Laravel 中。
我从评论中注意到您正在传递$orgs
,而不是$org
在函数中。
public function create() {
return view('Admin.organizations.create',compact('orgs'));
}
更新您的刀片文件,如下所示:
<div class="panel-heading ">Organization Profile</div>
<table class="table table-striped">
<thead>
<tr>
<th>Attributes</th>
<th>Values</th>
</tr>
</thead>
<tbody>
<tr>
<td>Org Name</td>
<td>{{$orgs->name}}</td>
</tr>
<tr>
<td>Owner Name</td>
<td>{{$orgs->owner}}</td>
</tr>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句