23-01-2026
This commit is contained in:
parent
a939cd51ef
commit
a8b395e20d
248 changed files with 29342 additions and 4805 deletions
71
app/Models/ProductBundle.php
Normal file
71
app/Models/ProductBundle.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ProductBundle Model - Verwaltet Set/Kit Produkt-Beziehungen
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class ProductBundle
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $product_id
|
||||
* @property int $bundle_product_id
|
||||
* @property int $quantity
|
||||
* @property int $pos
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Product $product
|
||||
* @property Product $bundleProduct
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProductBundle newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProductBundle newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProductBundle query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProductBundle whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProductBundle whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProductBundle whereProductId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProductBundle whereBundleProductId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProductBundle whereQuantity($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProductBundle wherePos($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ProductBundle whereUpdatedAt($value)
|
||||
*
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class ProductBundle extends Model
|
||||
{
|
||||
protected $table = 'product_bundles';
|
||||
|
||||
protected $casts = [
|
||||
'product_id' => 'int',
|
||||
'bundle_product_id' => 'int',
|
||||
'quantity' => 'int',
|
||||
'pos' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'product_id',
|
||||
'bundle_product_id',
|
||||
'quantity',
|
||||
'pos',
|
||||
];
|
||||
|
||||
/**
|
||||
* Das Set/Kit-Produkt (Parent)
|
||||
*/
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo(Product::class, 'product_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Das enthaltene Produkt (Child)
|
||||
*/
|
||||
public function bundleProduct()
|
||||
{
|
||||
return $this->belongsTo(Product::class, 'bundle_product_id');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue