PhilMarc PhilMarc - 1 year ago 45
PHP Question

How to check if Laravel request has no input

I am using Laravel 4.

I am willing to display a text, only if my request contains no


For instance, I have a product list
and I have an input field to filter by price, which gives the following URL once clicked:

I can use
to check if I have this input, but the thing is that I have a bunch of input fields, and I would like to display text only when there are no inputs.

I am thinking about something like:

//Do nothing
//Display my text here

But in a simplified way...

I was thinking of checking the URi with
and see if it matches
but it does even with the inputs active.

Answer Source

Get all input data, and count it:

@if ( ! count(Input::all()))
  // Display text here