PHP code example of kazuki / laravel-where-like
1. Go to this page and download the library: Download kazuki/laravel-where-like 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/ */
kazuki / laravel-where-like example snippets
// Search for Ichiro working in Tokyo
$words = ['Ichiro', 'Tokyo'];
$comulns = ['name', 'company.address'];
$users = User::whereLike($columns, $words)->get();
// Search for who working in Tokyo or Osaka
$words = ['Tokyo', 'Osaka'];
$comulns = ['company.address'];
$users = User::whereLike($columns, $words, 0, 'or')->get();