问题描述
我正在寻求帮助,
刀片片段:
<div class="project-card">
<a href="{{ route('title',['project' => '1978-reel-boom'],app()->getLocale() ) }}" >
<img alt="1978 Reel Boom" title="1978 Reel Boom" src="{image}">
<p>1978 Reel Boom</p>
</a>
</div>
<div class="project-card">
<a href="{{ route('title',['project' => '1979-cubus-diebach'],app()->getLocale() ) }}" >
<img alt="1979 Cubus Diebach" title="1979 Cubus Diebach" src="{image}">
<p>1979 Cubus Diebach</p>
</a>
</div>
我的路线如下所示:
Route::get('architectuur/{project}',['as' => 'title','uses' => 'App\Http\Controllers\ArchitectureController@showProject'])->name('title');
但我收到此错误:
我的想法是我可以制作一个单独的刀片页面,该页面将响应标题并根据标题显示带有该项目图像的轮播。 (无数据库)
解决方法
您只需要定义您的路线名称,无需添加as
。
Route::get('architectuur/{project}','App\Http\Controllers\ArchitectureController@showProject')
->name('title');