This commit is contained in:
Kamil Niemczycki 2023-07-30 12:10:23 +02:00
parent 127ebe79ae
commit 54db2e8e2b
Signed by: kamilniemczycki
GPG Key ID: 04D4E2012F969213
6 changed files with 15 additions and 40 deletions

View File

@ -1,17 +1,13 @@
<?php
declare(strict_types=1);
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\ResourceCollection;
class CategoryCollection extends ResourceCollection
{
/**
* Transform the resource collection into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
{
return CategoryResource::collection($this->collection);

View File

@ -1,21 +1,16 @@
<?php
declare(strict_types=1);
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class CategoryResource extends JsonResource
{
public static $wrap = null;
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
public function toArray($request): array
{
return [
'id' => $this->id,

View File

@ -4,14 +4,13 @@ declare(strict_types=1);
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Http\Resources\Json\ResourceCollection;
class FullCVCollection extends ResourceCollection
{
public function toArray($request): array
public function toArray($request): array|JsonResource
{
return [
'data' => $this->collection,
];
return FullCVResource::collection($this->collection);
}
}

View File

@ -1,18 +1,15 @@
<?php
declare(strict_types=1);
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Http\Resources\Json\ResourceCollection;
class ProjectCollection extends ResourceCollection
{
/**
* Transform the resource collection into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
public function toArray($request): JsonResource
{
return ProjectResource::collection($this->collection);
}

View File

@ -1,21 +1,16 @@
<?php
declare(strict_types=1);
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class ProjectResource extends JsonResource
{
public static $wrap = null;
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
*/
public function toArray($request)
public function toArray($request): array
{
return [
'id' => $this->id,
@ -30,5 +25,4 @@ class ProjectResource extends JsonResource
'description' => $this->description,
];
}
}

View File

@ -68,12 +68,6 @@ function copySlug(slug) {
<td class="hidden md:table-cell p-2">{{ cv.locations.join(' / ') }}</td>
<td class="p-2">{{ cv.phone.formattedNumber }}</td>
<td class="flex items-center justify-center gap-2 p-3 z-50">
<a
class="px-3 py-3 text-blue-600 hover:text-blue-800"
:href="`https://cv.kamilcraft.com/show/${cv.token}`"
target="_blank"
rel="noopener noreferrer"
title="Przekieruj do CV"><FontAwesomeIcon :icon="['fas', 'arrow-up-right-from-square']" /></a>
<InertiaLink
as="button"
class="px-3 py-3 text-lime-600 hover:text-lime-800 border-t-2 border-b-2 border-transparent hover:border-b-lime-600"