Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

chrisgrim's avatar

"Missing required parameters for [Route: brand_names] [URI: {channel}/{brand}].

Hi, I recently started the tdd forum tutorial and ran across a bit of an issue. I am calling my web route with a name

<a href="{{route('brand_names', $brand->slug)}}">

It was working until I tried to add channels. In the tutorial I have setup the show method like so

 public function show($channelId, Brand $brand)
    {

        return view('brands.show', [
            'brand' => $brand,
            'reviews' => $brand->reviews()->latest()->get(),
            'coupons' => $brand->coupons()->latest()->get(),
            'randomBrands' => Brand::where('id', '!=', $brand->id)->inRandomOrder()->limit(3)->get(),  
            'channelId' => $brand->channel_id,
        ]);
    }

I am not sure how to give the required parameter for the channel I tried

<a href="{{route('brand_names', $brand->slug, $channelId)}}">

but that doesnt work. How do I pass the second channel parameter?

Thanks!

0 likes
2 replies
qiutuleng's avatar
Level 2

@chrisgrim The route function in vendor/laravel/framework/src/Illuminate/Foundation/helpers.php file.

function route($name, $parameters = [], $absolute = true)
{
    return app('url')->route($name, $parameters, $absolute);
}

You should use array to pass multiple attributes.

like this:

route('brand_names', [$brand->slug, $channelId]);

The order of array items is your order in the route parameters definition.

Please or to participate in this conversation.