You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
512 B

  1. <?php
  2. namespace App\Http\Resources;
  3. use Carbon\Carbon;
  4. use Illuminate\Http\Resources\Json\ResourceCollection;
  5. class TaskCollection extends ResourceCollection
  6. {
  7. /**
  8. * Transform the resource collection into an array.
  9. *
  10. * @param \Illuminate\Http\Request $request
  11. * @return array
  12. */
  13. public function toArray($request)
  14. {
  15. return [
  16. 'tasks' => TaskResource::collection($this->collection),
  17. 'now' => Carbon::now()->toDateString()
  18. ];
  19. }
  20. }