adrema/app/Http/Resources/UserResource.php

27 lines
528 B
PHP
Raw Normal View History

2020-04-10 20:32:12 +02:00
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
use Storage;
class UserResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
2021-06-21 23:50:09 +02:00
'name' => $this->getFirstname(),
'email' => null,
2020-04-10 20:32:12 +02:00
'avatar' => [
'src' => Storage::url('avatar.png')
]
];
}
}