Added OTS create,store,show
This commit is contained in:
@@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
@@ -23,6 +24,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
* @property-read TeamMember|null $pivot
|
||||
* @property-read Collection<int, User> $members
|
||||
* @property-read int|null $members_count
|
||||
* @property-read Collection<int, OneTimeSecret> $receivedOneTimeSecrets
|
||||
* @property-read int|null $received_one_time_secrets_count
|
||||
*
|
||||
* @method static Builder<static>|Team newModelQuery()
|
||||
* @method static Builder<static>|Team newQuery()
|
||||
@@ -53,6 +56,11 @@ class Team extends Model
|
||||
return $this->hasMany(TeamInvite::class);
|
||||
}
|
||||
|
||||
public function receivedOneTimeSecrets(): MorphMany
|
||||
{
|
||||
return $this->morphMany(OneTimeSecret::class, 'recipient');
|
||||
}
|
||||
|
||||
#[Scope]
|
||||
public function scopeVisibleTo(Builder $query, User $user): Builder
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user