mivita/app/Models/ProductCategory.php
2023-07-03 10:07:08 +02:00

47 lines
1.7 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* App\Models\ProductCategory
*
* @property int $id
* @property int $product_id
* @property int $category_id
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\Category $category
* @property-read \App\Models\Product $product
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductCategory whereCategoryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductCategory whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductCategory whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductCategory whereProductId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductCategory whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductCategory newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductCategory newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductCategory query()
* @property int|null $pos
* @method static \Illuminate\Database\Eloquent\Builder|ProductCategory wherePos($value)
* @mixin \Eloquent
*/
class ProductCategory extends Model
{
protected $table = 'product_categories';
protected $fillable = [
'product_id', 'category_id', 'pos'
];
public function product()
{
return $this->belongsTo('App\Models\Product', 'product_id');
}
public function category()
{
return $this->belongsTo('App\Models\Category', 'category_id');
}
}