Homparty dev
This commit is contained in:
parent
9252094a04
commit
ac0d5b781e
60 changed files with 3443 additions and 293 deletions
|
|
@ -105,6 +105,9 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Product whereWpNumber($value)
|
||||
* @property bool|null $shipping_addon
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Product whereShippingAddon($value)
|
||||
* @property-read int|null $ingredients_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProductIngredient[] $product_ingredients
|
||||
* @property-read int|null $product_ingredients_count
|
||||
*/
|
||||
class Product extends Model
|
||||
{
|
||||
|
|
@ -230,6 +233,20 @@ class Product extends Model
|
|||
return $this->hasMany(CountryPrice::class, 'product_id');
|
||||
}
|
||||
|
||||
|
||||
public function p_ingredients()
|
||||
{
|
||||
return $this->belongsToMany(Ingredient::class, 'product_ingredients')
|
||||
->withPivot('id')
|
||||
->withTimestamps();
|
||||
}
|
||||
|
||||
public function product_ingredients()
|
||||
{
|
||||
return $this->hasMany(ProductIngredient::class, 'product_ingredients', 'id');
|
||||
}
|
||||
|
||||
|
||||
public function getActionName($id = 0){
|
||||
if(isset($this->actions[$id])){
|
||||
return $this->actions[$id];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue