gpt4 book ai didi

laravel - 缺少 [Route : addapplication. 编辑] 所需的参数

转载 作者:行者123 更新时间:2023-12-04 09:34:52 24 4
gpt4 key购买 nike

我在将 application_id 从 application@edit Controller 传递到 addapplication@index Controller 时遇到问题。请帮我。
application@edit Controller

$application->application_id = $request->application_id;

$application->save();

return redirect(route('addapplication.index'))->with('application_id',$request->application_id);
addapplication@index Controller
$application_id = Session::get('application_id');

$applications = addapplication::where('application_id', $application_id)->get();

return view('user.addapplication.index',compact('applications'));
Blade.php
@foreach ($applications as $application)
<tr>
<td>{{ $loop->index +1 }}</td>
<td>{{ $application->application_id }}</td>
<td>{{ $application->created_at }}</td>
<td>{{ $application->surname }}, {{ $application->firstname }} {{ $application->middlename }}</td>
<td><a href = "{{ route('addapplication.edit', $application->id)}}"><img src = {{ asset('assets/img/eye.ico') }}/></a>
</td>
</tr>
@endforeach
我收到此错误:

Missing required parameters for [Route: addapplication.edit] [URI:addapplication/{addapplication}/edit]. (View: D:\path\index.blade.php)


这是我的 route.php
Route::resource('application', 'ApplicationController');
Route::resource('addapplication', 'AddApplicationController');
请帮我。谢谢!

最佳答案

你必须像这样使用

{{route('addapplication.edit',['addapplication'=>$application->id])}}

关于laravel - 缺少 [Route : addapplication. 编辑] 所需的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62637037/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com