diff --git a/app/Models/OrderArchivesItem.php b/app/Models/OrderArchivesItem.php index 77371df..a8fbd5f 100644 --- a/app/Models/OrderArchivesItem.php +++ b/app/Models/OrderArchivesItem.php @@ -2,10 +2,18 @@ namespace App\Models; +use App\Enums\StockStatusEnum; use Illuminate\Database\Eloquent\Relations\BelongsTo; class OrderArchivesItem extends BaseAuditable { + protected function casts(): array + { + return [ + 'stock_status' => StockStatusEnum::class, + ]; + } + /** * The items that belong to the OrderArchive. */ diff --git a/database/migrations/2026_05_05_070449_add_stock_status_to_order_archives_items_table.php b/database/migrations/2026_05_05_070449_add_stock_status_to_order_archives_items_table.php new file mode 100644 index 0000000..eda2a64 --- /dev/null +++ b/database/migrations/2026_05_05_070449_add_stock_status_to_order_archives_items_table.php @@ -0,0 +1,25 @@ +string('stock_status')->default('in_stock')->after('status'); + }); + } + + public function down(): void + { + Schema::table('order_archives_items', function (Blueprint $table) { + $table->dropColumn('stock_status'); + }); + } +};