dev-think-one /
laravel-iprosoftware-sync
| 1 | <?php |
||
| 2 | |||
| 3 | namespace IproSync\Models; |
||
| 4 | |||
| 5 | use Carbon\Carbon; |
||
| 6 | |||
| 7 | trait HasPullAt |
||
| 8 | { |
||
| 9 | 3 | public function getHasPullAtCastsAttr() |
|
| 10 | { |
||
| 11 | 3 | return [ |
|
| 12 | 3 | 'last_pull_at' => 'datetime', |
|
| 13 | 3 | ]; |
|
| 14 | } |
||
| 15 | |||
| 16 | public function fillPulled(?Carbon $datetime = null): static |
||
| 17 | { |
||
| 18 | return $this->fill([ |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 19 | 'last_pull_at' => $datetime ?? Carbon::now(), |
||
| 20 | ]); |
||
| 21 | } |
||
| 22 | } |
||
| 23 |