Files
2026-05-09 17:32:17 +02:00

26 lines
500 B
PHP
Executable File

<?php
declare(strict_types=1);
namespace App\Http\Resources;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Http\Resources\Json\JsonResource;
use JsonSerializable;
class UserResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @return array|Arrayable|JsonSerializable
*/
#[\Override]
public function toArray($request): array
{
return [
'data' => $this->resource ?: 'No user found',
];
}
}