year)) { $attributes->year = year(); } }); } protected $fillable = [ 'year', 'order_number', 'status', 'user_id', 'product_id', 'quantity', 'in_stock', ]; const DEFAULT_SORT_BY = 'created_at'; public function user(): BelongsTo { return $this->belongsTo(User::class); } public function product(): BelongsTo { return $this->belongsTo(Product::class); } public function products_sku(): HasMany { return $this->hasMany(ProductSKU::class); } }