* change layout * change layout * #22 - wip * wip * wip * #22 - wip * #22 - wip * #22 - wip * #22 - wip * #22 - fix * #22 - wip * #22 - added some tests * #22 - wip * #22 - wip * #22 - fix * #22 - wip * #22 - wip * #22 - wip * #22 - fix * #22 - fix * #22 - fix * #22 - fix * #22 - fix * #22 - fix * #22 - cr fixes * #22 - cr fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl>
This commit is contained in:
@@ -13,9 +13,11 @@ class VacationRequestActivityResource extends JsonResource
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
"date" => $this->created_at->toDisplayString(),
|
||||
"who" => $this->user ? $this->user->fullName : __("System"),
|
||||
"to" => $this->to->label(),
|
||||
"date" => $this->created_at->format("d.m.Y"),
|
||||
"time" => $this->created_at->format("H:i"),
|
||||
"user" => $this->user ? $this->user->fullName : __("System"),
|
||||
"state" => $this->to,
|
||||
"text" => $this->to->label(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -17,11 +17,11 @@ class VacationRequestResource extends JsonResource
|
||||
"name" => $this->name,
|
||||
"user" => new UserResource($this->user),
|
||||
"type" => $this->type->label(),
|
||||
"state" => $this->state->label(),
|
||||
"state" => $this->state,
|
||||
"from" => $this->from->toDisplayString(),
|
||||
"to" => $this->to->toDisplayString(),
|
||||
"estimatedDays" => $this->estimated_days,
|
||||
"comment" => $this->comment,
|
||||
"days" => VacationResource::collection($this->vacations),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
21
app/Infrastructure/Http/Resources/VacationResource.php
Normal file
21
app/Infrastructure/Http/Resources/VacationResource.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Toby\Infrastructure\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class VacationResource extends JsonResource
|
||||
{
|
||||
public static $wrap = null;
|
||||
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
"id" => $this->id,
|
||||
"displayDate" => $this->date->toDisplayString(),
|
||||
"date" => $this->date->toDateString(),
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user