Add new badge. Update screenshot.
This commit is contained in:
@@ -31,7 +31,7 @@ class Product extends Model
|
||||
|
||||
public function isStarred(): bool
|
||||
{
|
||||
return (bool) $this->starred;
|
||||
return (bool)$this->starred;
|
||||
}
|
||||
|
||||
public function currentPrice(): HasOne
|
||||
@@ -65,4 +65,10 @@ class Product extends Model
|
||||
set: fn(array $value) => json_encode($value),
|
||||
);
|
||||
}
|
||||
|
||||
public function isnew(): bool
|
||||
{
|
||||
$newDate = (new \DateTime())->modify('-30 days')->format('Y-m-d');
|
||||
return $this->created_at->format('Y-m-d') > $newDate;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user