ResourceResource.php 538 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /*
  3. * This file is part of the Jiannei/lumen-api-starter.
  4. *
  5. * (c) Jiannei <longjian.huang@foxmail.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace App\Http\Resources;
  11. use Illuminate\Http\Resources\Json\JsonResource;
  12. class ResourceResource extends JsonResource
  13. {
  14. public function toArray($request)
  15. {
  16. return [
  17. 'id' => $this->id,
  18. 'path' => $this->path,
  19. 'url' => $this->url,
  20. ];
  21. }
  22. }