Added more imports

This commit is contained in:
Constantin Graf
2024-03-11 19:12:51 +01:00
parent 77e7a63b83
commit 66a1d8a38b
52 changed files with 1646 additions and 56 deletions

View File

@@ -13,6 +13,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
use Laravel\Jetstream\Events\TeamCreated;
use Laravel\Jetstream\Events\TeamDeleted;
use Laravel\Jetstream\Events\TeamUpdated;
use Laravel\Jetstream\Jetstream;
use Laravel\Jetstream\Team as JetstreamTeam;
/**
@@ -21,6 +22,7 @@ use Laravel\Jetstream\Team as JetstreamTeam;
* @property bool $personal_team
* @property User $owner
* @property Collection<User> $users
* @property Collection<string, User> $realUsers
*
* @method HasMany<OrganizationInvitation> teamInvitations()
* @method static OrganizationFactory factory()
@@ -64,7 +66,7 @@ class Organization extends JetstreamTeam
/**
* Get all the non-placeholder users of the organization including its owner.
*
* @return Collection<User>
* @return Collection<string, User>
*/
public function allRealUsers(): Collection
{
@@ -78,6 +80,19 @@ class Organization extends JetstreamTeam
});
}
/**
* Get all the users that belong to the team.
*
* @return BelongsToMany<User>
*/
public function users(): BelongsToMany
{
return $this->belongsToMany(Jetstream::userModel(), Jetstream::membershipModel())
->withPivot('role')
->withTimestamps()
->as('membership');
}
/**
* @return BelongsToMany<User>
*/