F
Filament16mo ago
Roberto

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
Patrick Boivin16mo ago
Looks good... Make sure to setup the relationship on both User and Team models.
Roberto
RobertoOP16mo ago
thank you
Want results from more Discord servers?
Add your server