I have encountered a problem, it seems i'm missing 'slug'from the link, if i put in that $slug i get an undefined variable, any ideas on how i should define the slug in that button? Missing required parameters for [Route: thread.show] [URI: forum/{slug}/t={id}].
Controller:
public function show($slug)
{
//
$forum = Forum::where('slug', '=', $slug)->first();
$thread = Thread::all()->sortBy('created_at');
return view('forum.show')->with('forum', $forum)->withThread($thread);
}
view:
@foreach($forum->threads as $threads)
<a href=""><p></p></a>
@endforeach
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire