[WIP] Working on orders & invoices
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user