adrema/app/Activity/Resources/ActivityResource.php

28 lines
496 B
PHP
Raw Normal View History

2023-02-14 14:27:11 +01:00
<?php
namespace App\Activity\Resources;
use App\Activity;
use Illuminate\Http\Resources\Json\JsonResource;
/**
* @mixin Activity
*/
class ActivityResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
*
* @return array{id: int, name: string}
*/
public function toArray($request)
{
return [
'name' => $this->name,
'id' => $this->id,
];
}
}