[WIP] Working on orders & invoices

This commit is contained in:
Ludovic CANDELLIER
2022-08-19 22:04:44 +02:00
parent 1880b25407
commit dae8156164
32 changed files with 440 additions and 323 deletions

View File

@@ -7,9 +7,25 @@ use Illuminate\Database\Eloquent\Model;
class OrderDetail extends Model
{
protected $guarded = ['id'];
protected $table = 'shop_order_details';
public function order()
{
return $this->belongsTo(Order::class);
}
public function offer()
{
return $this->belongsTo(Offer::class);
}
public function scopeByOrder($query, $order_id)
{
return $query->where('order_id', $order_id);
}
public function scopeByOffer($query, $offer_id)
{
return $query->where('offer_id', $offer_id);
}
}