ClearBowl/api/app/Models/RecipeProduct.php

33 lines
569 B
PHP
Raw Normal View History

2019-12-15 15:45:22 +01:00
<?php
namespace App;
use App\Models\Product;
use Illuminate\Database\Eloquent\Model;
use App\Traits\HasCompositeKey;
class RecipeProduct extends Model
{
use HasCompositeKey;
protected $primaryKey = ['recipe_id', 'product_id'];
protected $with = ['product'];
public $incrementing = false;
public $timestamps = false;
protected $table = 'recipe_products';
protected $guarded = ['id'];
protected $hidden = ['recipe_id', 'product_id'];
public function product()
{
return $this->belongsTo(Product::class);
}
}