I am trying to make some relationships between some tables but have an error that states..
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 (SQL: alter table
usersadd constraintusers_board_id_foreignforeign key (board_id) references `` ())
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->foreign('board_id')->unsigned();
$table->foreign('board_id')->references('id')->on('boards');
$table->foreign('message_id')->references('id')->on('messages');
$table->foreign('message_id')->unsigned();
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
This table is supposed to be related to this table...
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateBoardsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('boards', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 100)->unique();
$table->foreign('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users');
$table->foreign('link_id')->unsigned();
$table->foreign('link_id')->references('id')->on('links');
$table->foreign('message_id')->unsigned();
$table->foreign('message_id')->references('id')->on('messages');
$table->foreign('tag_id')->unsigned();
$table->foreign('tag_id')->references('id')->on('tags');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('boards');
}
}
I've already drop the table and the schema and started fresh and still get the same error! Please be kind :!

