lasthourcloud/app/Http/Livewire/Team/Invitations.php

24 lines
531 B
PHP
Raw Normal View History

2023-06-12 10:00:01 +00:00
<?php
namespace App\Http\Livewire\Team;
use App\Models\TeamInvitation;
use Livewire\Component;
class Invitations extends Component
{
public $invitations;
protected $listeners = ['refreshInvitations'];
2023-06-12 10:00:01 +00:00
public function deleteInvitation(int $invitation_id)
{
TeamInvitation::find($invitation_id)->delete();
$this->refreshInvitations();
}
public function refreshInvitations()
{
$this->invitations = TeamInvitation::whereTeamId(auth()->user()->currentTeam()->id)->get();
}
2023-06-12 10:00:01 +00:00
}