@@ -87,9 +87,9 @@ Consider to **clear the cache** whenever you make a new **deployment/migration**
87
87
88
88
---
89
89
90
- #### ` fromToday `
90
+ #### ` fromToday ` , ` fromYesterday `
91
91
92
- Select all entries created today.
92
+ Select all entries created today or yesterday .
93
93
94
94
``` php
95
95
use LaracraftTech\LaravelUsefulTraits\UsefulScopes;
@@ -105,32 +105,8 @@ $class = new class extends Model
105
105
$class->create(['foo' => 'foo1', 'bar' => 'bar1', 'quz' => 'quz1']);
106
106
$class->create(['foo' => 'foo2', 'bar' => 'bar2', 'quz' => 'quz2', 'created_at' => now()->yesterday()]);
107
107
108
- $class::select('foo')->fromToday()->first()->toArray();
109
- // return ['foo' => 'foo1']
110
- ```
111
-
112
- ---
113
-
114
- #### ` fromYesterday `
115
-
116
- Select all entries created yesterday.
117
-
118
- ``` php
119
- use LaracraftTech\LaravelUsefulTraits\UsefulScopes;
120
-
121
- $class = new class extends Model
122
- {
123
- use UsefulScopes;
124
-
125
- protected $timestamps = true;
126
- protected $table = 'scope_tests';
127
- };
128
-
129
- $class->create(['foo' => 'foo1', 'bar' => 'bar1', 'quz' => 'quz1']);
130
- $class->create(['foo' => 'foo2', 'bar' => 'bar2', 'quz' => 'quz2', 'created_at' => now()->yesterday()]);
131
-
132
- $class::select('foo')->fromYesterday()->first()->toArray();
133
- // return ['foo' => 'foo2']
108
+ $class::select('foo')->fromToday()->first()->toArray(); // return ['foo' => 'foo1']
109
+ $class::select('foo')->fromYesterday()->first()->toArray(); // return ['foo' => 'foo2']
134
110
```
135
111
136
112
### RefreshDatabaseFast
0 commit comments