| 123456789101112131415161718192021 |
- <?php
- namespace App\Http\Resources;
- use Illuminate\Http\Request;
- use Illuminate\Http\Resources\Json\ResourceCollection;
- class PermissionCollection extends ResourceCollection
- {
- /**
- * Transform the resource collection into an array.
- *
- * @return array<int|string, mixed>
- */
- public function toArray(Request $request): array
- {
- return $this->collection->transform(function ($permission) {
- return new PermissionResource($permission);
- })->toArray();
- }
- }
|