First Commit
This commit is contained in:
commit
610aa1e202
4204 changed files with 636764 additions and 0 deletions
42
app/Models/ProductCategory.php
Normal file
42
app/Models/ProductCategory.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?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)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class ProductCategory extends Model
|
||||
{
|
||||
protected $table = 'product_categories';
|
||||
|
||||
protected $fillable = [
|
||||
'product_id', 'category_id',
|
||||
];
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Product', 'product_id');
|
||||
}
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Category', 'category_id');
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue