first commit

This commit is contained in:
2020-03-21 15:52:49 +01:00
commit 3f96cc6fe3
126 changed files with 57882 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Http\Resources;
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 [
'data' => [
'type' => 'users',
'user_id' => $this->id,
'attributes' => [
'name' => $this->name,
],
],
'links' => [
'self' => url('/users/'.$this->id),
]
];
}
}