phpvms/app/Support/Resources/CustomAnonymousResourceCollection.php
Nabeel S 7481dab012
Remove extraneous data from API response; force API to en (#1241)
* Remove extraneous data from API response; force API to en

* Style fixes

* Remove

* Fix the meta block

* Style fixes
2021-06-09 11:20:25 -04:00

17 lines
485 B
PHP

<?php
namespace App\Support\Resources;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Illuminate\Pagination\AbstractPaginator;
class CustomAnonymousResourceCollection extends AnonymousResourceCollection
{
public function toResponse($request)
{
return $this->resource instanceof AbstractPaginator
? (new CustomPaginatedResourceResponse($this))->toResponse($request)
: parent::toResponse($request);
}
}