Files
Discount-Bandit/app/Console/Commands/DiscountTestNotificationCommand.php
YNWA Fawzy 49b03c2e79 Features:
- single time url with notification, where user can see the prices of other products and can check the trend of prices without logging in, each url is valid for 15 minutes only and has a unique value.
- filter to get products that are lowest within x days.
- add canadian tire store, Target

Fixes:
- change limit from 300 products to 60 every 5 minutes.
- fix best buy crawling single product
- fix best buy url is not viewable
- error when getting variation for best buy
- remove fnac from deployment, as they block after 2-3 tries everytime.

Took 11 hours 35 minutes
2024-10-03 23:55:59 +04:00

46 lines
1.2 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_id: 123,
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",
));
}
}