title: Integrity constraint violation: 1048 Column 'discussion_id' cannot be null (SQL: insert into `replies`
body: <p>I am getting this error SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'discussion_id' cannot be null (SQL: insert into <code>replies</code> (<code>content</code>, <code>discussion_id</code>, <code>user_id</code>, <code>updated_at</code>, <code>created_at</code>) values (asdfghjl, ?, 1, 2021-05-09 03:09:05, 2021-05-09 03:09:05)).</p>
  <p><strong>Here is my reply model</strong></p>
  <pre><code>&lt;?php
  
  namespace LaravelForum;
  
  
  
  class Reply extends Model
   {
     public function users()
      {
      return $this-&gt;belongsTo(User::class,'user_id');
      }
  
     public function discussion()
      {
     
      return $this-&gt;belongsTo(Discussion::class);
      }
  
   }
  </code></pre>
  <p><strong>reply table</strong></p>
  <pre><code>   &lt;?php
  
     use Illuminate\Support\Facades\Schema;
     use Illuminate\Database\Schema\Blueprint;
     use Illuminate\Database\Migrations\Migration;
  
     class CreateRepliesTable extends Migration
      {
       /**
        * Run the migrations.
        *
        * @return void
        */
       public function up()
        {
          Schema::create('replies', function (Blueprint $table) {
              $table-&gt;bigIncrements('id');
              $table-&gt;integer('user_id');
              $table-&gt;integer('discussion_id');
              $table-&gt;string('content');
              $table-&gt;timestamps();
          });
        }
  
          /**
         * Reverse the migrations.
         *
         * @return void
         */
       public function down()
       {
         Schema::dropIfExists('replies');
       }
   }
  </code></pre>
  <p><strong>Discussion model</strong></p>
  <pre><code>  &lt;?php
  
    namespace LaravelForum;
  
  
  
    class Discussion extends Model
    {
      public function author()
       {
        return $this-&gt;belongsTo(User::class,'user_id');
       }
  
     public function getRouteKeyName()
      {
      return 'slug';
      }
  
  
  
  
    }
  </code></pre>
  <p><strong>discussion table</strong></p>
  <pre><code> &lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateDiscussionsTable extends Migration
   {
    /**
     * Run the migrations.
     *
     * @return void
     */
     public function up()
      {
           Schema::create('discussions', function (Blueprint $table) {
             $table-&gt;bigIncrements('id');
             $table-&gt;integer('user_id');
             $table-&gt;string('title');
             $table-&gt;text('content');
             $table-&gt;string('slug');
             $table-&gt;integer('channel_id');
             $table-&gt;timestamps();
         });
      }
  
     /**
      * Reverse the migrations.
      *
      * @return void
      */
     public function down()
      {
        Schema::dropIfExists('discussions');
      }
   }
  </code></pre>