Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

812 B
Raw Blame
<?php

namespace App\Livewire\Team\Member;

use App\Models\TeamInvitation;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Livewire\Component;

class Index extends Component
{
    use AuthorizesRequests;

    public $invitations = [];

    public function mount()
    {
        // Only load invitations for users who can manage them
        if (auth()->user()->can('manageInvitations', currentTeam())) {
            $this->invitations = TeamInvitation::whereTeamId(currentTeam()->id)->get();
        }
    }

    public function render()
    {
        $members = currentTeam()->members;

        return view('livewire.team.member.index', [
            'members' => $members,
            'membersWithoutTwoFactorCount' => $members->whereNull('two_factor_confirmed_at')->count(),
        ]);
    }
}