If you have a Category model you could pass it a show method in your controller eg function show(Category $category_values){ return view( 'category.show', compact('category_values'); } Then in your show.blade view you could try the link_to_route() method, first argument is the name of the route, second the string displayed and third the id passed @foreach ($category as $category_values) <li> {!! link_to_route('category.show', $product_category_values->tbl_product_category_name, [category_values->tbl_product_category_id]) !!}
</li>
@endforeach
I haven't tried any of this out and I'm very much a beginner but its how I have approached similar in the past
dragonfire3310 said:
If you have a Category model you could pass it a show method in your controller eg function show(Category $category_values){ return view( 'category.show', compact('category_values'); } Then in your show.blade view you could try the link_to_route() method, first argument is the name of the route, second the string displayed and third the id passed @foreach ($category as $category_values) <li> {!! link_to_route('category.show', $product_category_values->tbl_product_category_name, [category_values->tbl_product_category_id]) !!}
</li>
I haven't tried any of this out and I'm very much a beginner but its how I have approached similar in the past
Hi dragonfire3310,
Actually I need the result on the same page. What I am trying is, passing a category id in to controller page and do some query then return to same view page (View.blade.php -> Controller page -> View.blade.php).
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community