Initial commit

This commit is contained in:
2024-02-22 21:14:12 +01:00
commit 1153029afa
98 changed files with 13995 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class UserResource extends JsonResource
{
public static $wrap = null;
/**
* Transform the resource into an array.
*
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'email' => $this->email,
'roles' => RoleResource::collection($this->whenLoaded('roles')),
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}