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
23 lines
512 B
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
|
|
|
class TaskCollection extends ResourceCollection
|
|
{
|
|
/**
|
|
* Transform the resource collection into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'tasks' => TaskResource::collection($this->collection),
|
|
'now' => Carbon::now()->toDateString()
|
|
];
|
|
}
|
|
}
|