Laravel provides the features and structure for generating your application's URLs straight out of the box. This works well as long as we're generating URLs within our application.

In this short post, I'll explain how you can use the internal Laravel's route feature set to generate your external URLs.

We'll define our new routes in a standard Laravel routes file, register them with a new RouteServiceProvider and generate URLs with the route() helper function.

Since we're generating external routes, make sure those domains aren't bound to your current application.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners