1. Go to this page and download the library: Download sfneal/datum library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sfneal / datum example snippets
php
useIlluminate\Database\Eloquent\Builder;
useSfneal\Filters\Filter;
classNameLastFilterimplementsFilter{
/**
* Apply a given search value to the builder instance.
*
* @param Builder $query
* @param mixed $value
* @return Builder $query
*/publicfunctionapply(Builder $query, $value): Builder{
$query->whereIn('name_last', (array) $value);
return $query;
}
}
classCityFilterimplementsFilter{
/**
* Apply a given search value to the builder instance.
*
* @param Builder $query
* @param mixed $value
* @return Builder $query
*/publicfunctionapply(Builder $query, $value): Builder{
$query->whereIn('city', (array) $value);
return $query;
}
}