33 lines
557 B
PHP
33 lines
557 B
PHP
<?php namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class BundleItem extends Model
|
|
{
|
|
protected $fillable = [
|
|
'bundle_id',
|
|
'inventory_id',
|
|
'quantity',
|
|
];
|
|
|
|
protected $casts = [
|
|
'quantity' => 'integer',
|
|
];
|
|
|
|
/**
|
|
* Bundle al que pertenece este item
|
|
*/
|
|
public function bundle()
|
|
{
|
|
return $this->belongsTo(Bundle::class);
|
|
}
|
|
|
|
/**
|
|
* Producto componente
|
|
*/
|
|
public function inventory()
|
|
{
|
|
return $this->belongsTo(Inventory::class);
|
|
}
|
|
}
|