diff --git a/database/migrations/2021_10_28_093227_create_images_table.php b/database/migrations/2021_10_28_093227_create_images_table.php index bdc5888..198cdfa 100644 --- a/database/migrations/2021_10_28_093227_create_images_table.php +++ b/database/migrations/2021_10_28_093227_create_images_table.php @@ -15,7 +15,7 @@ class CreateImagesTable extends Migration { Schema::create('images', function (Blueprint $table) { $table->uuid("uuid")->unique()->primary; - $table->foreignUuid("product_uuid")->references("uuid")->on("products"); + $table->foreignUuid("product_uuid")->nullable()->references("uuid")->on("products")->nullOnDelete(); $table->string('path')->unique(); $table->timestamps(); }); diff --git a/resources/scss/product.scss b/resources/scss/product.scss new file mode 100644 index 0000000..ca62984 --- /dev/null +++ b/resources/scss/product.scss @@ -0,0 +1,44 @@ +.product-container { + display: flex; + + flex-wrap: wrap; + & > div { + width: 49%; + padding: 1em; + } +} + +.product-image { + width: 100%; +} + +.name-price-container { + display: flex; + justify-content: space-between; + align-items: flex-end; +} + +.price-currency { + font-size: 0.85em; + opacity: 0.55; + font-weight: normal; +} + +.product-commands { + &, button { + width: 100%; + } + +} + +.admin-menu { + display: flex; + width: 100%; + & * { + width: 100%; + } +} + +.admin-menu-button { + width: 100%; +} diff --git a/resources/views/product/view.blade.php b/resources/views/product/view.blade.php index fc8fa97..6647e35 100644 --- a/resources/views/product/view.blade.php +++ b/resources/views/product/view.blade.php @@ -1,31 +1,56 @@ - - -
- - -- {{ $product }} -
- - - - -+ {{ $product->description }} +
+