migration er time ta important table relation ship er jonno $table->unsignedBigInteger('writer_id'); $table->foreign('writer_id')->references('id')->on('writers'); OR $table->foreignId('writer_id')->constrained(); $table->foreignId('devision_id')->constrained('devisions')->nullable(); $table->integer('quantity'); $table->integer('damage')->default(0)->nullable(); $table->boolean('status')->default(0)->nullable()->comment('Active or Inactive'); $table->decimal('amount',12,2)->nullable(); $table->enum('status',['active','inactive'])->default('inactive'); $table->float('discount'); $table->foreign('category_id')->references('id')->on('product_categories'); $table->foreign('category_id')->reference('id')->on('product_categories'); $table->id(); $table->string('name',255)->nullable(); $table->string('email')->unique(); $table->text('description'); $table->integer('price')->default(100); $table->float('amount', 8, 2); $table->unsignedInteger('user_id'); $table->boolean('name'); $table->foreignId('user_id'); $table->ipAddress('visitor'); $table->macAddress('device'); $table->json('options'); $table->date('starting_date'); $table->dateTime('ending_date', $precision = 0); $table->tinyInteger('votes'); $table->timestamps(); $table->foreign('user_id')->reference('id')->on('users')->onDelete('casecade'); $table->foreignId('user_id')->constrained()->onUpdate('cascade')->onDelete('cascade'); $table->foreign('user_id')->references('id')->on('users'); ------------------------------------------------------------------- /app/Providers/AppServiceProvider.php use Illuminate\Support\Facades\Schema; public function boot() { Schema::defaultStringLength(191); }