26 lines
481 B
PHP
26 lines
481 B
PHP
<?php
|
|
|
|
namespace App\Models\Shop;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ProductPrice extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
public function Product()
|
|
{
|
|
return $this->belongsTo('App\Models\Shop\Product');
|
|
}
|
|
|
|
public function ProductAttribute()
|
|
{
|
|
return $this->belongsTo('App\Models\Shop\ProductAttribute');
|
|
}
|
|
|
|
public function scopeByProduct($query, $id)
|
|
{
|
|
return $query->where('product_id', $id);
|
|
}
|
|
|
|
} |