2018-07-27 06:22:12 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Webkul\Product\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2018-07-27 09:30:48 +00:00
|
|
|
use Webkul\Category\Models\Category;
|
2018-07-27 06:22:12 +00:00
|
|
|
|
|
|
|
|
class Product extends Model
|
|
|
|
|
{
|
|
|
|
|
protected $guarded = ['_token'];
|
2018-07-27 09:30:48 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The categories that belong to the product.
|
|
|
|
|
*/
|
|
|
|
|
public function categories()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsToMany(Category::class, 'product_categories');
|
|
|
|
|
}
|
2018-07-27 06:22:12 +00:00
|
|
|
}
|