first commit
This commit is contained in:
commit
0baac018a2
1011 changed files with 145854 additions and 0 deletions
56
app/Models/ProductIngredient.php
Normal file
56
app/Models/ProductIngredient.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ProductIngredient
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $product_id
|
||||
* @property int $ingredient_id
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Ingredient $ingredient
|
||||
* @property Product $product
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient whereIngredientId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient whereProductId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class ProductIngredient extends Model
|
||||
{
|
||||
protected $table = 'product_ingredients';
|
||||
|
||||
protected $casts = [
|
||||
'product_id' => 'int',
|
||||
'ingredient_id' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'product_id',
|
||||
'ingredient_id'
|
||||
];
|
||||
|
||||
public function ingredient()
|
||||
{
|
||||
return $this->belongsTo(Ingredient::class, 'ingredient_id');
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo(Product::class, 'product_id');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue