11.08.2017 Views

codebright

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Basic Routing 52<br />

Basic Routing<br />

Let’s take a look at a request being made to the Laravel framework.<br />

1 http://domain.com/my/page<br />

In this example, we are using the http protocol (used by most web browsers) to access your Laravel<br />

application hosted on domain.com. The my/page portion of the URL is what we will use to route web<br />

requests to the appropriate logic.<br />

I’ll go ahead and throw you in at the deep end. Routes are defined in the app/routes.php file, so<br />

let’s go ahead and create a route that will listen for the request we mentioned above.<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!