@ehab.aboshehab I'm afraid the suggestion doesn't work. Not sure why. Here is my adjusted controller code. If I'm wrong, please point it out
public function NaturalSubShow($category, $slug) {
$categories = HairBlogCategory::where('slug', $slug)->first();
$subcategories = HairBlogSubCategory::where('slug', $slug)->first();
return view('natural-hair-blogs.subcat.show', compact('subcategories','categories'));
}
In my route web I have it adjusted like
Route::get('/natural-hair-blogs/s/{category}/{id}/{slug}', [HairBlogCategoryController::class, 'NaturalSubShow'])->name('natural.subcategories.show');
And in my blade I have it like this. I know there is something wrong with my code, but I don't what.
{{ URL::to('/natural-hair-blogs/s').'/'.$category->slug.'/'.$subcategory->slug }}"