vat_wms/app/Models/StockEntry2Attributes.php
2025-05-13 12:32:55 +02:00

60 lines
1.3 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class StockEntry2Attributes extends Model
{
use HasFactory;
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'stock_entry2attributes';
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'stock_attributes_id',
'stock_attribute_value_id',
];
/**
* Indicates if the model has a primary key.
*
* @var bool
*/
public $incrementing = false;
/**
* The primary key for the model.
*
* @var array
*/
protected $primaryKey = ['stock_attributes_id', 'stock_attribute_value_id'];
/**
* Get the attribute that this relationship belongs to.
*/
public function attribute(): BelongsTo
{
return $this->belongsTo(StockAttributes::class, 'stock_attributes_id');
}
/**
* Get the attribute value that this relationship belongs to.
*/
public function attributeValue(): BelongsTo
{
return $this->belongsTo(StockAttributeValues::class, 'stock_attribute_value_id');
}
}