PHP code example of blasttech / laravel-where-plus

1. Go to this page and download the library: Download blasttech/laravel-where-plus library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

blasttech / laravel-where-plus example snippets


  $query->whereOrEmptyOrNull('Country', $input['country'], '');

  $query->where('Country', $input['country']);

$query->whereOrEmptyOrNull('Country', $input['country'], 'Australia');

  $query->whereOrEmptyOrNull([
          'Country' => $input['country'],
          'State' => $input['state'],
          'Locality' => $input['locality']
      ], '', '');

  $query->whereInColumn('Country', 'Australia');

  $query->whereNotInColumn('Country', 'Australia');

  $query->whereIfNull('Country', 'Australia', '=', 'New Zealand');

Calls::make()
  ->select(['calltype'])
  ->addCount('id')
  ->addSum('seconds')
  ->addSum('seconds', 'seconds2')
  ->groupBy('calltype');

Calls::make()
  ->select(['calltype', 'description'])
  ->addSum('charge')
  ->groupByIndex(1, 2);
  ->orderByIndex(1);