Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

JhumanJ/OpnForm

3005 stars
2 code files
View JhumanJ/OpnForm on GitHub

app/Models/Workspace.php

Open in GitHub
class Workspace extends Model
{
//
public function users()
{
return $this->belongsToMany(User::class);
}
 
public function owners()
{
return $this->users()->wherePivot('role', 'admin');
}
//
}

database/migrations/2022_09_12_074636_remove_access_token_from_workspaces.php

Open in GitHub
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
 
return new class extends Migration
{
public function up()
{
Schema::table('user_workspace', function (Blueprint $table) {
$table->dropColumn('access_token');
$table->dropColumn('is_owner');
$table->string('role')->default('admin');
});
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.