| 123456789101112131415161718192021222324252627282930 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- class StoreItemVariation extends Model
- {
- protected $fillable = [
- 'store_item_id',
- 'variation_type',
- 'variation_label',
- 'variation_value',
- 'stock',
- ];
- protected function casts(): array
- {
- return [
- 'variation_value' => 'float',
- 'stock' => 'integer',
- ];
- }
- public function storeItem(): BelongsTo
- {
- return $this->belongsTo(StoreItem::class);
- }
- }
|