Pivot Table Laravel

giriaditya Mar 22nd, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function up() {
  2.     Schema::create('book_category', function (Blueprint $table) {
  3.         $table->increments('id');
  4.         $table->integer('book_id')->unsigned()->nullable();
  5.         $table->integer('category_id')->unsigned()->nullable();
  6.         $table->timestamps(); $table->foreign('book_id')->references('id')->on('books');
  7.         $table->foreign('category_id')->references('id')- >on('categories');
  8.     });
  9. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand