#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Route Parameters and Named Routes

Real applications rarely have only static URLs — a blog needs a route per post, a shop needs a route per product. Laravel handles this through route parameters, and it lets developers reference routes by name instead of hardcoding URLs everywhere.

Route Parameters

A route parameter is a placeholder in the URL pattern that captures part of the request and passes it into the controller or closure. Parameters can be required or optional, and Laravel supports constraining them with regular expressions when needed.

Named Routes

Rather than typing out full URLs throughout an application, Laravel lets you assign a name to a route and generate links or redirects using that name instead. If the underlying URL ever changes, every reference automatically updates, since nothing depends on the literal path.

SyntaxExample
Required parameterRoute::get('/post/{id}', ...)
Optional parameterRoute::get('/post/{id?}', ...)
Naming a routeRoute::get('/post/{id}', ...)->name('post.show')
Generating a URL from a nameroute('post.show', ['id' => 1])

Why This Matters

Routes work well for small amounts of logic, but as an application grows, that logic needs a proper home — which is exactly the role controllers play.

Ready to master Laravel Training Course?

Join Uncodemy's hands-on Laravel program and build real, production-ready applications.

Explore Course