*/ public function team(): BelongsTo { return $this->belongsTo(Team::class); } /** * Get the user that belongs to this membership. * * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'role' => TeamRole::class, ]; } }