Added Category model, resource and its API.

Updated Company model to have Categories.
This commit is contained in:
2023-06-14 16:58:35 +03:00
parent 505fa2e831
commit b5a264d92f
12 changed files with 341 additions and 0 deletions
@@ -0,0 +1,24 @@
<?php
namespace App\Http\Resources\API\v2;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class CategoryResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'uuid' => $this->uuid,
'name' => $this->name,
'url' => $this->url,
];
}
}