File: /var/www/vhost/disk-apps/agile-selling-wpb/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'];
protected $fillable = ['plu', 'max_units_per_order', 'price', 'name', 'bin_location', 'brand_id', 'order'];
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 boItemManualPrices(){
return $this->hasMany( BoItemManualPrice::class );
}
public function productImages(){
return $this->hasMany( ProductImage::class );
}
public function sucursal(){
return $this->belongsTo( Sucursal::class );
}
public function bo_sales_tax_code(){
return $this->belongsTo( BoSalesTaxCode::class );
}
}