File: /var/www/kasoviaparati.net/app/Product.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
protected $fillable = [
'name',
'manufacturer_id',
'productcategory_id',
'producttype_id',
'price',
'price_eur',
'description',
'accent',
'weight',
];
protected $table = 'products';
public function manufacturer()
{
return $this->belongsTo('App\Manufacturer');
}
public function productcategory()
{
return $this->belongsTo('App\Productcategory');
}
public function producttype()
{
return $this->belongsTo('App\Producttype');
}
public function images()
{
return $this->hasMany('App\Productimage');
}
}