title: how to handle null value in Laravel Eloquent?
body: <p>i am new in laravel.Actually i want to filter some data on state and typeofsupply column. like if state=&quot;south australia&quot; and typeofsupply=&quot;Inverter &amp; Storage&quot; then show me these rows who exist on both value.and if i filter like state=&quot;south australia&quot; and typeofsupply=Nul.then these rows will be display who exist state of south australia and typeofsupply should be any of list(All type of supply)</p>
  <pre><code>public function show(Request $request){
  
      $typeofsupply='';
      $state='';
      if(!$request-&gt;all()==Null) {
  
          if(!$request-&gt;state==Null) {
              $state=$request-&gt;state;
          }
          if(!$request-&gt;typeofsupply==Null) {
              $typeofsupply=$request-&gt;typeofsupply;
          }
  
          $items = Postjob::where('state',$state)
                          -&gt;where('typeofsupply',$typeofsupply)
                          -&gt;get();
          dd($items);
  </code></pre>