| 12345678910111213141516171819202122232425 |
- <?php
- namespace App\Http\Resources;
- use Illuminate\Http\Request;
- use Illuminate\Http\Resources\Json\JsonResource;
- class ClientProviderBlockResource extends JsonResource
- {
- public function toArray(Request $request): array
- {
- return [
- 'id' => $this->id,
- 'client_id' => $this->client_id,
- 'provider_id' => $this->provider_id,
- 'provider_name' => $this->provider_name ?? $this->provider?->user?->name,
- 'provider_email' => $this->provider_email ?? $this->provider?->user?->email,
- 'provider_phone' => $this->provider_phone ?? $this->provider?->user?->phone,
- 'provider_district'=> $this->provider_district ?? null,
- 'provider_rating' => $this->provider_rating ?? null,
- 'created_at' => $this->created_at?->format('Y-m-d H:i'),
- 'updated_at' => $this->updated_at?->format('Y-m-d H:i'),
- ];
- }
- }
|