Support the ongoing development of Laravel.io →
posted 9 years ago
Views
Last updated 2 years ago.
0

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

0

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>

@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

Last updated 9 years ago.
0

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).

0

Issue has solved thanks for your effort.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.