I am working with laravel 5.6 and need show file in catagory.show file using CatagoryController show function,
public function show($id)
{
$catagories = Catagory::find($id);
return view('catagory.show')->withCatagories($catagories);
}
this is my route
Route::get('post-ad/{catagories}', [
'uses' => 'CatagoryController@show',
'as' => 'catagory.show',
]);
and my link page to this page link is
@if(isset($catagories))
@foreach ($catagories as $cata)
<div class="col-md-9">
<div class="col-md-3 text-center">
<a href=""><img src="" alt="profile Pic" height="50" width="50" class="center-block"></a>
<div><a href="/post-ad/"></div>
</div>
@endforeach
@endif
but I got following error msg,
UrlGenerationException
Missing required parameters for [Route: catagory.show] [URI: post-ad/{catagories}].
how can fix this problem?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire