首页 > 解决方案 > 此收款实例支付刀片上不存在属性 [id]

问题描述

有没有人知道这个错误:

Property [id] does not exist on this collection instance. (View: D:\projet7899\laravel-only-school-managemnt\resources\views\backend\payment\edit.blade.php)

付款/edit.blade.php

<div class="table w-full mt-8 bg-white rounded">
            <form action="{{ route('payment.update',$payment->id) }}" method="POST" class="w-full max-w-xl px-6 py-12">
                @csrf

有人有想法吗?提前致谢

标签: phplaravellaravel-blade

解决方案


Double check your controller is returning a model instance for $payment instead of a collection. For example, use ->first() instead of ->get().


推荐阅读