This repository has been archived by the owner on Feb 16, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
``` $this->ofInput('name', $searchData, 'and', true) ->ofInput('cellphone', $searchData, 'and', true) ->findAll(); ``` Custom base model method: ``` /** * Search from request input. * * @param Builder $query * @param string $field * @param string|array $value * @param string $boolean * @param bool $like * * @return Builder */ public function scopeOfInput($query, $field, $value, $boolean = 'and', $like = false) { if (is_array($value) && !isset($value[$field])) { return $query; } return $this->_where($query, $field, $value[$field], $boolean, $like); } ```
- Loading branch information