feat(wip member dashboard)
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 26h10m31s
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 26h10m31s
This commit is contained in:
23
app/Http/Resources/MemberResource.php
Normal file
23
app/Http/Resources/MemberResource.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class MemberResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'firstname' => $this->firstname,
|
||||
'lastname' => $this->lastname,
|
||||
'email' => $this->email,
|
||||
'retzien_email' => $this->retzien_email,
|
||||
'membership' => new MembershipResource($this->whenLoaded('lastActiveMembership')),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user