Files
solidtime/app/Http/Resources/V1/ProjectMember/ProjectMemberResource.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

35 lines
884 B
PHP

<?php
declare(strict_types=1);
namespace App\Http\Resources\V1\ProjectMember;
use App\Http\Resources\V1\BaseResource;
use App\Models\ProjectMember;
use Illuminate\Http\Request;
/**
* @property ProjectMember $resource
*/
class ProjectMemberResource extends BaseResource
{
/**
* Transform the resource into an array.
*
* @return array<string, string|bool|int|null>
*/
public function toArray(Request $request): array
{
return [
/** ID of project member */
'id' => $this->resource->id,
/** Billable rate in cents per hour */
'billable_rate' => $this->resource->billable_rate,
/** ID of the organization member */
'member_id' => $this->resource->member_id,
/** ID of the project */
'project_id' => $this->resource->project_id,
];
}
}