feat: Socket Support and Event Examples

This commit is contained in:
2023-11-10 18:07:55 +01:00
parent ce6405cb8a
commit eac670642a
14 changed files with 754 additions and 16 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,
];
}
}