title: If request is not null statement in Eloquent
body: <p>How to execute statement in query only if request exists?
  Example: $request->type (if NULL search everywhere if not check only arriving filghts)</p>
  
  <pre><code>$flights = App\Flight::where('active', 1)
                 -&gt;orderBy('name', 'desc')
                 -&gt;if($requst-&gt;type = NULL) return all; else { -&gt;where('type', $request-&gt;type)
                 -&gt;get();
  </code></pre>
  
  <p>Thank you for help! :)</p>