Updated Filament Model
This commit is contained in:
@@ -19,7 +19,13 @@ class Filament extends Model
|
|||||||
'weight',
|
'weight',
|
||||||
'diameter',
|
'diameter',
|
||||||
'price',
|
'price',
|
||||||
'stock'
|
'finish',
|
||||||
|
'image',
|
||||||
|
'stock',
|
||||||
|
'temp_min',
|
||||||
|
'temp_max',
|
||||||
|
'buildplate_id',
|
||||||
|
'extruder_id'
|
||||||
];
|
];
|
||||||
|
|
||||||
// Filament belongs to a type
|
// Filament belongs to a type
|
||||||
|
|||||||
@@ -22,6 +22,13 @@ return new class extends Migration
|
|||||||
$table->string('weight')->required();
|
$table->string('weight')->required();
|
||||||
$table->string('diameter')->required();
|
$table->string('diameter')->required();
|
||||||
$table->string('price')->nullable();
|
$table->string('price')->nullable();
|
||||||
|
$table->string('finish')->nullable();
|
||||||
|
$table->string('image')->nullable();
|
||||||
|
$table->integer('stock')->default(0);
|
||||||
|
$table->integer('temp_min')->nullable();
|
||||||
|
$table->integer('temp_max')->nullable();
|
||||||
|
$table->integer('buildplate_id')->nullable();
|
||||||
|
$table->integer('extruder_id')->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*/
|
|
||||||
public function up(): void
|
|
||||||
{
|
|
||||||
Schema::table('filaments', function (Blueprint $table) {
|
|
||||||
// adding stock to filaments table
|
|
||||||
$table->integer('stock')->default(0);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::table('filaments', function (Blueprint $table) {
|
|
||||||
// removing stock from filaments table
|
|
||||||
$table->dropColumn('stock');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user