mirror of
https://github.com/Cybrarist/Discount-Bandit.git
synced 2026-11-24 19:49:54 +01:00
- Added groups, where you can set bunch of items with identified unique keys to get the lowest price on group of products. ( think of it like building your own PC, you add multiple CPUs, and GPUs and the program will notify you when the combination reaches a desired price) - Added 2FA Support to the system (Optional) - Make Sidebar collapsable - Fix name is too short which results to not be saved - Fix a bug where product can be duplicated from amazon stores
30 lines
579 B
PHP
30 lines
579 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Casts\Money;
|
|
use App\Enums\StatusEnum;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Group extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $guarded=["id"];
|
|
|
|
protected $casts=[
|
|
"notify_price"=>Money::class,
|
|
"status"=>StatusEnum::class
|
|
];
|
|
|
|
public function currency (){
|
|
return $this->belongsTo(Currency::class);
|
|
}
|
|
|
|
public function products(){
|
|
return $this->belongsToMany(Product::class)->withTimestamps()->withPivot("key");
|
|
}
|
|
|
|
}
|