This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccount/app/Http/Resources/API/User.php
2019-04-25 17:33:15 +02:00

29 lines
No EOL
743 B
PHP

<?php
namespace App\Http\Resources\API;
use Illuminate\Http\Resources\Json\JsonResource;
class User extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
{
return [
'id' => (int)$this->id,
'username' => $this->username,
'created_at' => $this->created_at,
'updated_at' => $this->created_at,
'primaryMail' => $this->getMail(),
'status' => $this->status,
'inviteCode' => $this->inviteCode,
'developer' => (bool)$this->developer,
'admin' => (bool)$this->admin
];
}
}