Files
Discount-Bandit/app/Console/Commands/DiscountTestNotificationCommand.php
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

45 lines
1.1 KiB
PHP

<?php
namespace App\Console\Commands;
use App\Models\User;
use App\Notifications\GroupDiscount;
use App\Notifications\ProductDiscount;
use App\Notifications\ProductDiscounted;
use Illuminate\Console\Command;
class DiscountTestNotificationCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'discount:test-notify';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Test Notification and make sure it works fine';
/**
* Execute the console command.
*/
public function handle(): void
{
User::first()->notify(new ProductDiscounted(
product_name: "This is a test product",
store_name: "this is a test store",
price: 100,
highest_price: 120,
lowest_price: 80,
product_url: "https://cybrarist.com",
image: "https://raw.githubusercontent.com/Cybrarist/Discount-Bandit/refs/heads/master/storage/app/public/bandit.png",
currency: "$",
tags: ",New Test Tags",
));
}
}