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');
71
71
```
72
72
73
73
#### 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
74
77
``` php
75
- Airtable::where('name', 'myName')->get();
78
+ Airtable::where('id', '5')->get();
79
+ Airtable::where('id', '>', '5')->get();
76
80
```
77
81
78
82
#### First or Create
Original file line number Diff line number Diff line change @@ -48,9 +48,13 @@ public function table($table)
48
48
return $ this ;
49
49
}
50
50
51
- public function where ($ column , $ value )
51
+ public function where ($ column , $ operator , $ value = null )
52
52
{
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
+ }
54
58
}
55
59
56
60
public function firstOrCreate (array $ idData , array $ createData = [])
You can’t perform that action at this time.
0 commit comments