How to check if Laravel request has no input
Get all input data, and count it:
@if ( ! count(Input::all()))
// Display text here
@endif
@if (!request()->filled('price') || !request()->filled('mixed') || !request()->filled('male') || !request()->filled('female'))
// Display my text here
@endif
Before Laravel 5.4:
$request->exists
: Determine if the request contains a given input item key.$request->has
: Determine if the request contains a non-empty value for an input item.
In Laravel 5.5:
$request->exists
: Alias for $request->has$request->has
: Determine if the request contains a given input item key.$request->filled
: Determine if the request contains a non-empty value for an input item.