ClientProviderBlockResource.php 740 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Http\Resources;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Http\Resources\Json\JsonResource;
  5. class ClientProviderBlockResource extends JsonResource
  6. {
  7. public function toArray(Request $request): array
  8. {
  9. return [
  10. 'id' => $this->id,
  11. 'client_id' => $this->client_id,
  12. 'provider_id' => $this->provider_id,
  13. 'provider_name' => $this->provider->user->name ?? null,
  14. 'provider_email' => $this->provider->user->email ?? null,
  15. 'provider_phone' => $this->provider->user->phone ?? null,
  16. 'created_at' => $this->created_at?->format('Y-m-d H:i'),
  17. 'updated_at' => $this->updated_at?->format('Y-m-d H:i'),
  18. ];
  19. }
  20. }