Файл: app/Http/Resources/AccountResource.php
Строк: 32
<?php
namespace AppHttpResources;
use IlluminateHttpResourcesJsonJsonResource;
class AccountResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param IlluminateHttpRequest $request
* @return array
*/
public function toArray($request)
{
return [
'id' => $this->id,
'name' => $this->name,
'email' => $this->email,
'avatar_url' => gravatar($this->email, 96),
'locale' => $this->locale,
'timezone' => $this->timezone,
'plan' => collect($this->plan)->only(['id', 'name', 'features']),
'created_at' => $this->created_at
];
}
/**
* Get any additional data that should be returned with the resource array.
*
* @param IlluminateHttpRequest $request
* @return array
*/
public function with($request)
{
return [
'status' => 200
];
}
}