25 lines
500 B
PHP
Executable File
25 lines
500 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class UserResource extends JsonResource
|
|
{
|
|
public static $wrap = 'user';
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->getKey(),
|
|
'nom' => $this->name,
|
|
'email' => $this->email,
|
|
];
|
|
}
|
|
}
|