11.08.2017 Views

codebright

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Responses 64<br />

If you now visit the /first URI you will be greeted with the text ‘Second route.’. This is because<br />

upon receiving the returned Redirect object, Laravel has shifted the flow of our application to the<br />

target destination. In this case the flow has been shifted to the closure of the second route.<br />

This can be really useful when a condition of some kind has failed and you need to redirect the user<br />

to a more useful location. Here’s an example using the authentication system (which we will cover<br />

later) that will provide another use case.<br />

1

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

Saved successfully!

Ooh no, something went wrong!