I want to display Size Attribute value list beside Size using laravel

Viewed 55

For Attribute i can make two table 1 is attributes and another is attribute_values

For attributes table

Schema::create('attributes', function (Blueprint $table) {
      $table->bigIncrements('id');
      $table->string('attributeName')->unique();
      $table->timestamps();
  });

For attribute_values table

Schema::create('attribute_values', function (Blueprint $table) {
    $table->bigIncrements('id');
    $table->unsignedBigInteger('attributeId');
    $table->string('value')->unique();
    $table->timestamps();
});

I want to show like:

Under Size: L, S, M, XL etc

Under Color: Red, Green etc

What is the query ? and how can i apply ?

enter image description here

1 Answers
Related