File: /var/www/wsklad/app/Distributorassortment.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Distributorassortment extends Model
{
protected $fillable = [
'DISTRIBUTOR_F_KONTRAGENT',
'CODE',
];
protected $table = 'distributor_assortment';
public function distributor()
{
return $this->hasOne('App\Ajurendpointdistributor', 'F_KONTRAGENT', 'DISTRIBUTOR_F_KONTRAGENT');
}
public function product()
{
return $this->hasOne('App\Ajurendpointproduct', 'CODE', 'CODE');
}
public function shortname()
{
return $this->hasOne('App\Productshortname', 'CODE', 'CODE');
}
}