* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * lint fixes * missing empty lines * translations * fix vue version * #134 - fixes * fix * fix * #134 - fix * fix * fix * #134 - added tests * #134 - fix to translations * #134 - tests * #134 - fix * Update database/factories/ResumeFactory.php Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com> * #134 - fix * #134 - fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl> Co-authored-by: Krzysztof Rewak <krzysztof.rewak@gmail.com>
This commit is contained in:
26
app/Infrastructure/Http/Resources/ResumeFormResource.php
Normal file
26
app/Infrastructure/Http/Resources/ResumeFormResource.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Toby\Infrastructure\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ResumeFormResource extends JsonResource
|
||||
{
|
||||
public static $wrap = null;
|
||||
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
"id" => $this->id,
|
||||
"user" => $this->user_id,
|
||||
"name" => $this->name,
|
||||
"description" => $this->description,
|
||||
"education" => $this->education,
|
||||
"languages" => $this->languages,
|
||||
"technologies" => $this->technologies,
|
||||
"projects" => $this->projects,
|
||||
];
|
||||
}
|
||||
}
|
28
app/Infrastructure/Http/Resources/ResumeResource.php
Normal file
28
app/Infrastructure/Http/Resources/ResumeResource.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Toby\Infrastructure\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ResumeResource extends JsonResource
|
||||
{
|
||||
public static $wrap = null;
|
||||
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
"id" => $this->id,
|
||||
"user" => new SimpleUserResource($this->user),
|
||||
"name" => $this->name,
|
||||
"description" => $this->description,
|
||||
"educationCount" => $this->education->count(),
|
||||
"languageCount" => $this->languages->count(),
|
||||
"technologyCount" => $this->technologies->count(),
|
||||
"projectCount" => $this->projects->count(),
|
||||
"createdAt" => $this->created_at->toDisplayString(),
|
||||
"updatedAt" => $this->updated_at->toDisplayString(),
|
||||
];
|
||||
}
|
||||
}
|
20
app/Infrastructure/Http/Resources/TechnologyResource.php
Normal file
20
app/Infrastructure/Http/Resources/TechnologyResource.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Toby\Infrastructure\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class TechnologyResource extends JsonResource
|
||||
{
|
||||
public static $wrap = null;
|
||||
|
||||
public function toArray($request): array
|
||||
{
|
||||
return [
|
||||
"id" => $this->id,
|
||||
"name" => $this->name,
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user