This commit is contained in:
Doar Mihai
2026-04-03 01:04:19 +03:00
parent 2b930a0636
commit 1cbe5bfe3b
12 changed files with 536 additions and 2 deletions
@@ -0,0 +1,26 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class JobCategoryResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'slug' => $this->slug,
'description' => $this->description,
'icon' => $this->icon,
'jobs_count' => $this->when(isset($this->jobs_count), $this->jobs_count),
];
}
}