[Vuejs]-Relationship Error When Foreign Key is Null in Laravel Vue.Js

0๐Ÿ‘

โœ…

I think you should put unsigned () in schema like this form

  public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('role_id')->index()->unsigned()->nullable();
            $table->rememberToken();
            $table->timestamps();
        });
    }

and you can check the doc below for more information

https://laravel.com/docs/5.8/migrations

Leave a comment