Add ability to set relationships through the api (#1181)

This commit is contained in:
Régis Freyd
2018-04-17 07:29:50 -04:00
committed by GitHub
parent 4f88e5a0ea
commit 08f19c853d
16 changed files with 581 additions and 26 deletions
@@ -0,0 +1,24 @@
<?php
namespace App\Http\Resources\Relationship;
use Illuminate\Http\Resources\Json\ResourceCollection;
class RelationshipCollection extends ResourceCollection
{
/**
* Transform the resource collection into an array.
*
* @param \Illuminate\Http\Request
* @return array
*/
public function toArray($request)
{
return [
'data' => $this->collection,
'links' => [
'self' => 'link-value',
],
];
}
}