File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,12 @@ Airtable::find('id_string');
7171```
7272
7373#### Filter records
74+ - First argument is the column name
75+ - Second argument is the operator or the value if you want to use equal '=' as an operator.
76+ - Third argument is the value of the filter
7477``` php
75- Airtable::where('name', 'myName')->get();
78+ Airtable::where('id', '5')->get();
79+ Airtable::where('id', '>', '5')->get();
7680```
7781
7882#### First or Create
Original file line number Diff line number Diff line change @@ -48,9 +48,13 @@ public function table($table)
4848 return $ this ;
4949 }
5050
51- public function where ($ column , $ value )
51+ public function where ($ column , $ operator , $ value = null )
5252 {
53- return $ this ->api ->addFilter ($ column , '= ' , $ value );
53+ if (is_null ($ value )) {
54+ return $ this ->api ->addFilter ($ column , '= ' , $ operator );
55+ } else {
56+ return $ this ->api ->addFilter ($ column , $ operator , $ value );
57+ }
5458 }
5559
5660 public function firstOrCreate (array $ idData , array $ createData = [])
You can’t perform that action at this time.
0 commit comments