| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- /**
- * @property int $id
- * @property int $class_package_unit_id
- * @property int $product_id
- * @property int $quantity
- * @property float $price
- * @property \Carbon\Carbon $created_at
- * @property \Carbon\Carbon $updated_at
- */
- class ClassPackageUnitProduct extends Model
- {
- use HasFactory;
- protected $table = 'class_package_unit_products';
- protected $guarded = ['id'];
- protected $casts = [
- 'quantity' => 'integer',
- 'price' => 'float',
- 'created_at' => 'datetime',
- 'updated_at' => 'datetime',
- ];
- public function packageUnit(): BelongsTo
- {
- return $this->belongsTo(ClassPackageUnit::class, 'class_package_unit_id');
- }
- public function product(): BelongsTo
- {
- return $this->belongsTo(Product::class);
- }
- }
|