Multi tenant team and user question

Hello there, i want users to create a team and invite other users in multi tenant filament setup. is this how i do it?
// users table
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->string('password');
});

// teams table
Schema::create('teams', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->text('description');
});

// team_user pivot table
Schema::create('team_user', function (Blueprint $table) {
$table->unsignedBigInteger('user_id');
$table->unsignedBigInteger('team_id');
});
// users table
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('email')->unique();
$table->string('password');
});

// teams table
Schema::create('teams', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->text('description');
});

// team_user pivot table
Schema::create('team_user', function (Blueprint $table) {
$table->unsignedBigInteger('user_id');
$table->unsignedBigInteger('team_id');
});
Solution:
Looks good... Make sure to setup the relationship on both User and Team models.
Jump to solution
2 Replies
Solution
Patrick Boivin
Looks good... Make sure to setup the relationship on both User and Team models.
Roberto
RobertoOP2y ago
thank you

Did you find this page helpful?