Example of Pivot tables with extra fields in LaraBug/larabug-app

File app/Models/User.php (link to Github)
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    //
    public function projects()
    {
        return $this->belongsToMany(Project::class)->withPivot('owner');
    }
    //
}
File app/Http/Controllers/ProjectController.php (link to Github)
use App\Models\Project;
use App\Http\Requests\ProjectRequest;

class ProjectController extends Controller
{
    //
    public function store(ProjectRequest $request)
    {
        $project = Project::create($request->only([
            'title',
            'url',
            'description',
            'receive_email',
            'slack_webhook',
            'discord_webhook',
            'custom_webhook',
        ]));

        $request->user()->projects()->save($project, ['owner' => true]);

        return redirect()->route('panel.projects.installation', $project);
    }
    //
    public function edit($id)
    {
        $project = auth()->user()
            ->projects()
            ->findOrFail($id);

        if (!$project->isOwner()) {
            return redirect()->route('projects.show', $project)->withErrors([
                'You are not the main owner of this project, therefore you cannot edit the project.'
            ]);
        }

        return inertia('Projects/Edit', [
            'project' => $project
        ]);
    }
    //
}
File app/Models/Project.php (link to Github)
use Illuminate\Database\Eloquent\Model;

class Project extends Model
{
    //
    public function isOwner()
    {
        return $this->pivot->owner;
    }
    //
}