我无法访问我的admin_table我知道我有,并且在admin_table的路线上有问题,请在我的路线上帮助我 属性[id]在此收集实例上不存在。
我的admin_table.刀片
@foreach ($users as $positions)
@foreach ($positions->admins as $position )
<tbody>
<tr>
<td>{{ $position->id}}</td>
<td>{{ $position->first_name}}</td>
<td>{{ $position->last_name}}</td>
<td>{{ $position->contact}}</td>
<td>{{ $position->departments->department}}</td>
<td>{{ $position->schoolpositions->school_position}}</td>
<td>{{ $position->email}}</td>
<th> <a href="{{action('DashboardController@edit',$position['id' =>$position->id])}} " class="btn btn-success">Edit </a>
</th>
</tr>
</tbody>
@endforeach
</tr>
</tbody>
@endforeach
@endforeach
</table>
这是我的路线
Route::get('/admin_table', 'DashboardController@index');
Route::put('/admin_table/{id}', 'DashboardController@store');
Route::get('/admin_table', 'DashboardController@show');
Route::get('/teacher_editform/{id}', 'DashboardController@edit');
Route::put('/teacher_editform/{id}', 'DashboardController@update')->name('teacheradminpage.teacher_tableform.teacher_editform');
这是我的控制器
public function edit($id)
{
$departments = Department::find($id);
$users = Schoolposition::find($id);
$students = Student::find($id);
$admins = Admin::find($id);
return view('teacheradminpage.teacher_tableform.teacher_editform', compact('departments','users','students','admins', 'id', 'id', 'id', 'id'));
}
阿晨1998
素胚勾勒不出你
阿波罗的战车