Files
solidtime/app/Http/Resources/V1/Invitation/InvitationResource.php
Constantin Graf 7a3a9d7089 Fix Scramble API docs warnings
Remove redundant @var annotations from API resources and defer the user
access in the email unique rule of UserUpdateRequest, so rules() can be
evaluated by Scramble without route model binding. Add a test that fails
on any Scramble diagnostic and tests for the email unique rule.
2026-10-08 12:57:56 +02:00

33 lines
739 B
PHP

<?php
declare(strict_types=1);
namespace App\Http\Resources\V1\Invitation;
use App\Http\Resources\V1\BaseResource;
use App\Models\OrganizationInvitation;
use Illuminate\Http\Request;
/**
* @property OrganizationInvitation $resource
*/
class InvitationResource extends BaseResource
{
/**
* Transform the resource into an array.
*
* @return array<string, string|bool|int|null|array<string>>
*/
public function toArray(Request $request): array
{
return [
/** ID of the invitation */
'id' => $this->resource->id,
/** Email */
'email' => $this->resource->email,
/** Role */
'role' => $this->resource->role,
];
}
}