Files
YNWA Fawzy f037a936f3 Fixes:
- fix type when filtering product by price met target.
- fix the lowest price was overridden if price wasn't crawled.
- fix store tabs not working
- fix some european amazon using "." as thousands separator.
- keep last 3 days of logs only.
- added volume to .env to fix 2FA not working after restarting container
- added volume for database
-

New Stores:
- best buy

New Features:

- add other users to the system and manage their tokens.
- add telegram notification.
- add percentage drop.
- robot detection for amazon ( if the system was detected as robot, it will stop executing and try the next product, the same product that was blocked will be crawled again in the next batch)

Took 6 hours 50 minutes
2024-09-29 18:31:13 +04:00

44 lines
982 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Feed\Feedable;
use Spatie\Feed\FeedItem;
class RssFeedItem extends Model implements Feedable
{
use HasFactory;
protected $fillable=[
"data"
];
protected function casts(): array
{
return [
'data'=>'json'
];
}
public function toFeedItem(): FeedItem
{
return FeedItem::create([
"id"=>$this->id,
'title' => $this->data["title"],
'summary' => $this->data["summary"],
'updated' => now(),
'link' => route("filament.admin.resources.product-stores.edit" , $this->data["product_id"]),
'image' => Product::find($this->data["product_id"])->image,
'authorName' => "Discount Bandit",
]);
}
public static function getFeedItems()
{
return RssFeedItem::all();
}
}