%PDF- %PDF-
Direktori : /home/forge/api-takeaseat.eco-n-tech.co.uk/app/Http/Resources/ |
Current File : //home/forge/api-takeaseat.eco-n-tech.co.uk/app/Http/Resources/UserResource.php |
<?php namespace App\Http\Resources; use Illuminate\Http\Resources\Json\JsonResource; class UserResource extends JsonResource { /** * Transform the resource into an array. * * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) { return [ 'id' => $this->id, 'photo_url' => $this->photo_url ? $this->photo : asset('images/user-placeholder.png'), 'full_name' => $this->full_name, 'first_name' => $this->first_name, 'last_name' => $this->last_name, 'email' => $this->email, 'phone' => $this->phone, 'role' => $this->roles->first(), 'is_verified' => $this->hasVerifiedEmail(), 'is_subscribed' => $this->subscribed(config('subscription.product_id')), 'trial_ends_at' => $this->trial_ends_at !== null ? $this->trial_ends_at->diffForHumans() : null, ]; } }