@@ -87,9 +87,9 @@ Consider to **clear the cache** whenever you make a new **deployment/migration**
8787
8888---
8989
90- #### ` fromToday `
90+ #### ` fromToday ` , ` fromYesterday `
9191
92- Select all entries created today.
92+ Select all entries created today or yesterday .
9393
9494``` php
9595use LaracraftTech\LaravelUsefulTraits\UsefulScopes;
@@ -105,32 +105,8 @@ $class = new class extends Model
105105$class->create(['foo' => 'foo1', 'bar' => 'bar1', 'quz' => 'quz1']);
106106$class->create(['foo' => 'foo2', 'bar' => 'bar2', 'quz' => 'quz2', 'created_at' => now()->yesterday()]);
107107
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']
134110```
135111
136112### RefreshDatabaseFast
0 commit comments