Answers for "laravel view not created using foreign keys"

PHP
0

laravel view not created using foreign keys

Schema::create('larachat_chat_rooms', function (Blueprint $table) {
        $table->increments('id');
  		//Foreign key must be unsignedBigInteger
        $table->unsignedBigInteger('creator_id');  
        $table->softDeletes();
        $table->timestamps();

		//Define foreign key id here
        $table->foreign('creator_id')->references('id')->on('users')->onDelete('cascade');
    });
Posted by: Guest on August-02-2021

Code answers related to "laravel view not created using foreign keys"

Browse Popular Code Answers by Language