mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 08:12:17 +01:00
Added time entry api endpoints; Increased phpstan level; renamed to solidtime
This commit is contained in:
28
app/Http/Resources/V1/TimeEntry/TimeEntryResource.php
Normal file
28
app/Http/Resources/V1/TimeEntry/TimeEntryResource.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Resources\V1\TimeEntry;
|
||||
|
||||
use App\Models\TimeEntry;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
/**
|
||||
* @property TimeEntry $resource
|
||||
*/
|
||||
class TimeEntryResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, string|boolean|integer>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
/** @var string $id ID of time entry */
|
||||
'id' => $this->resource->id,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user