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.

Request Data 129<br />

1 string(3) "bar"<br />

Great! I wonder what would happen if the data didn’t exist? Let’s find out by visiting /.<br />

1 NULL<br />

So why do we have a null value? Well, if something can’t be found in Laravel, it likes to provide null<br />

instead of throwing an exception or interfering with our application’s execution. Instead, Laravel<br />

does something much more useful. It allows us to provide a default value as a fallback.<br />

Let’s alter our route to provide a fallback to the Input::get() method.<br />

1

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

Saved successfully!

Ooh no, something went wrong!