@Snapey I am Starting to do the Properties for a Particular Product so thought that it is better to add the Properties for a Particular Product.this can be done in the laravel ??
below is my Product table i need to add the Properties/attributes for every Product
because in the ecommerce site Properties may be different
for example if the Product is Book it can have author name,date of publish etc..
but if the Product is mobile it can have color,memory etc..
so i came up with the solution that in the controller if we create a table it could easy to implement.
I hope it understands!!
+------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+----------------+
| product_id | int(100) | NO | PRI | NULL | auto_increment |
| product_cat | int(100) | NO | | NULL | |
| product_brand | int(100) | NO | | NULL | |
| product_title | varchar(255) | NO | | NULL | |
| product_price | int(100) | NO | | NULL | |
| product_desc | text | NO | | NULL | |
| product_image | text | NO | | NULL | |
| product_keywords | text | NO | | NULL | |
+------------------+--------------+------+-----+---------+----------------+
@Snapey yeah I got it but this is not what i want can Laravel creates table/column in Controller Suppose if the admin adds the Properties like color for Mobile laravel should automatically create a column color in the table is there any options to achieve it??
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
class TableController extends Controller
{
public function createTable()
{
Schema::create('customers', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email');
$table->string('phone');
$table->timestamps();
});
}
}