File: /var/www/vhost/disk-apps/comfama.sports-crowd.com/app/Product.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Product extends Model
{
protected $dates = ['deleted_at'];
protected $guarded = ['id', 'deleted_at', 'created_at', 'updated_at'];
use SoftDeletes;
public function brand()
{
return $this->belongsTo(Brand::class);
}
public function subcategoryProduct()
{
return $this->hasMany(SubcategoryProduct::class);
}
public function subcategory_products()
{
return $this->hasMany(SubcategoryProduct::class);
}
public function productAttributes()
{
return $this->hasMany(ProductAttribute::class)->with('attribute');
}
public function productImages()
{
return $this->hasMany(ProductImage::class);
}
public function sucursal()
{
return $this->belongsTo(Sucursal::class);
}
}