Refactored Color Livewire components, added CreateColor, EditColor, and ShowColor components. Updated views, navigation, and Tailwind color schemes. Adjusted database migrations for consistency.
This commit is contained in:
@@ -11,7 +11,7 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('color', function (Blueprint $table) {
|
||||
Schema::create('colors', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->required();
|
||||
$table->string('hex')->required();
|
||||
|
||||
@@ -11,7 +11,7 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('manufacturer', function (Blueprint $table) {
|
||||
Schema::create('manufacturers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->required();
|
||||
$table->string('description')->nullable();
|
||||
|
||||
@@ -13,13 +13,14 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('filaments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name')->required();
|
||||
$table->string('name');
|
||||
$table->string('description')->nullable();
|
||||
$table->foreignId('color_id')->constrained()->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreignId('manufacturer_id')->constrained()->onUpdate('cascade')->onDelete('cascade');;
|
||||
$table->foreignId('filament_type_id')->constrained()->onUpdate('cascade')->onDelete('cascade');;
|
||||
$table->integer('weight')->required();
|
||||
$table->decimal('diameter', 10, 2)->required();
|
||||
// Foreign keys pointing to existing tables with non-standard names
|
||||
$table->foreignId('color_id')->constrained('colors')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreignId('manufacturer_id')->constrained('manufacturers')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->foreignId('filament_type_id')->constrained('filament_types')->onUpdate('cascade')->onDelete('cascade');
|
||||
$table->integer('weight');
|
||||
$table->decimal('diameter', 10, 2);
|
||||
$table->decimal('price', 10, 2)->nullable();
|
||||
$table->string('finish')->nullable();
|
||||
$table->string('image')->nullable();
|
||||
|
||||
@@ -11,13 +11,12 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('buildplate', function (Blueprint $table) {
|
||||
Schema::create('buildplates', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description');
|
||||
$table->foreignId('manufacturer_id')->constrained();
|
||||
$table->foreignId('manufacturer_id')->constrained('manufacturers');
|
||||
$table->string('temp_max');
|
||||
$table->string('amount');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,20 +15,20 @@ class ColorSeeder extends Seeder
|
||||
{
|
||||
// Seed predefined Colors
|
||||
$colors = [
|
||||
['name' => 'Red', 'hex' => '#FF0000'],
|
||||
['name' => 'Green', 'hex' => '#00FF00'],
|
||||
['name' => 'Blue', 'hex' => '#0000FF'],
|
||||
['name' => 'Yellow', 'hex' => '#FFFF00'],
|
||||
['name' => 'Orange', 'hex' => '#FFA500'],
|
||||
['name' => 'Purple', 'hex' => '#800080'],
|
||||
['name' => 'Pink', 'hex' => '#FFC0CB'],
|
||||
['name' => 'Brown', 'hex' => '#A52A2A'],
|
||||
['name' => 'Gray', 'hex' => '#808080'],
|
||||
['name' => 'Black', 'hex' => '#000000'],
|
||||
['name' => 'White', 'hex' => '#FFFFFF'],
|
||||
['name' => 'Gold', 'hex' => '#FFD700'],
|
||||
['name' => 'Silver', 'hex' => '#C0C0C0'],
|
||||
['name' => 'Cyan', 'hex' => '#00FFFF']
|
||||
['name' => 'Red', 'hex' => 'FF0000'],
|
||||
['name' => 'Green', 'hex' => '00FF00'],
|
||||
['name' => 'Blue', 'hex' => '0000FF'],
|
||||
['name' => 'Yellow', 'hex' => 'FFFF00'],
|
||||
['name' => 'Orange', 'hex' => 'FFA500'],
|
||||
['name' => 'Purple', 'hex' => '800080'],
|
||||
['name' => 'Pink', 'hex' => 'FFC0CB'],
|
||||
['name' => 'Brown', 'hex' => 'A52A2A'],
|
||||
['name' => 'Gray', 'hex' => '808080'],
|
||||
['name' => 'Black', 'hex' => '000000'],
|
||||
['name' => 'White', 'hex' => 'FFFFFF'],
|
||||
['name' => 'Gold', 'hex' => 'FFD700'],
|
||||
['name' => 'Silver', 'hex' => 'C0C0C0'],
|
||||
['name' => 'Cyan', 'hex' => '00FFFF']
|
||||
];
|
||||
|
||||
foreach ($colors as $color) {
|
||||
|
||||
Reference in New Issue
Block a user