Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +-------------------------------+
- | id | name | code |
- ---------------------------------
- | 1 | Employee 1 | A1 |
- | 2 | Employee 2 | A2 |
- | ... | ... | ... |
- +-------------------------------+
- SELECT name FROM employee WHERE code LIKE A1
- $this->crud->addFilter([
- 'type' => 'select2',
- 'name' => 'branch_code',
- 'label' => 'Filter',
- ],
- function() {
- return Employee::select('code')->distinct()->get()->pluck('code')->toArray();
- },
- function($value) {
- $this->crud->addClause('where', 'code', $value);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement