PermissionResource.php 655 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App\Http\Resources;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Http\Resources\Json\JsonResource;
  5. class PermissionResource extends JsonResource
  6. {
  7. /**
  8. * Transform the resource into an array.
  9. *
  10. * @return array<string, mixed>
  11. */
  12. public function toArray(Request $request): array
  13. {
  14. return [
  15. 'id' => $this->id,
  16. 'scope' => $this->scope,
  17. 'description' => $this->description,
  18. 'bits' => $this->bits,
  19. 'parent_id' => $this->parent_id,
  20. 'created_at' => $this->created_at,
  21. 'updated_at' => $this->updated_at,
  22. ];
  23. }
  24. }