php - “类 App\Http\Controllers\Frontend\FrontendController 不存在”
问题描述
我安装了一个 laravel 脚本。但是页面不起作用并出现
试图获取非对象的属性“名称”(查看:/mylocal/core/resources/views/admin/users/servicePrice.blade.php)
对于这一行:
<th>{{ $item->service->name }}</th>
这是文件代码:
<div class="tile">
@include('admin.layouts.flash')
<h3 class="tile-title">Service Price Details</h3>
<form method="post" action="{{ route('store.service.price', $user_id) }}">
@csrf
@method('PUT')
<table class="table table-hover">
<tbody>
@foreach($items as $item)
<tr>
<th>{{ $item->category->name }}</th>
<th>{{ $item->service->name }}</th>
<td>
<div class="input-group">
<input type="hidden" name="id[]" value="{{ $item->id }}">
<input class="form-control" type="text" name="price[]" value="{{ $item->price }}">
<div class="input-group-append">
<span class="input-group-text">{{ $general->currency_symbol }}</span>
</div>
</div>
</td>
</tr>
@endforeach
</table>
<div class="tile-footer">
<button class="btn btn-primary btn-block btn-lg" type="submit"><i
class="fa fa-fw fa-lg fa-check-circle"></i>Save
</button>
</div>
</form>
</div>
解决方案
您没有共享数组 $items 的内容。请确保您在 $items 数组中有一个服务数组,并确保名称变量存在于服务数组中。你能告诉我这个结果吗: var_dump($items);
推荐阅读
- python - 如何在python中仅提取字符串的指定部分
- json - ampUrls 批量获取 JSON 格式
- c# - 为层次链中的所有嵌套子级添加级联删除
- mongodb - 展开子对象数组
- html - 为什么CSS文件被取消了?
- python - Python:检查一个正则表达式是否覆盖另一个正则表达式
- c - 在进程树中查找子进程的级别
- html - iframe 无法正确显示 ios iphone
- java - 如何为集合和函数列表创建嵌套 for 循环
- java - Android context.getResources.updateConfiguration() deprecated 如何解决?