Added City model, resource and its API.

This commit is contained in:
2023-06-14 13:31:38 +03:00
parent 15f16db37c
commit 6d0423fa34
12 changed files with 351 additions and 7 deletions
@@ -0,0 +1,24 @@
<?php
namespace App\Http\Resources\API\v2;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class CityResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
//return parent::toArray($request);
return [
'id' => $this->id,
'uuid' => $this->uuid,
'name' => $this->name,
];
}
}