mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
33 lines
816 B
PHP
33 lines
816 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Resources\V1\Organization;
|
|
|
|
use App\Http\Resources\V1\BaseResource;
|
|
use App\Models\Organization;
|
|
use Illuminate\Http\Request;
|
|
|
|
/**
|
|
* @property Organization $resource
|
|
*/
|
|
class OrganizationResource extends BaseResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, string|bool|int|null>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
/** @var string $id ID */
|
|
'id' => $this->resource->id,
|
|
/** @var string $name Name */
|
|
'name' => $this->resource->name,
|
|
/** @var string $color Personal organizations automatically created after registration */
|
|
'is_personal' => $this->resource->personal_team,
|
|
];
|
|
}
|
|
}
|