app/Http/Resources/UserProfileResource.php
/**
     * Transform the resource into an array.
     *
     * @param  Request  $request
     * @return array
     */
Transform the resource into an array.
@param  Request  $request
@return array
Transform the resource into an array . @param Request $request @return array
public function toArray($request): array
    {
        $parent = parent::toArray($request);
        return array_merge($parent, [
            'avatar' => $this->profileImage ? env('IMAGE_PATH') . '/user_profile/small_square/' . $this->profileImage->filename : null,
            'email' => $this->email,
            'gender' => $this->gender,
            'birthYear' => $this->birthyear,
            'description' => $this->description,
            'notify_message' => $this->notify_message,
            'notify_follow' => $this->notify_follow,
            'contact_facebook' => $this->contact_facebook,
            'contact_twitter' => $this->contact_twitter,
            'contact_instagram' => $this->contact_instagram,
            'contact_homepage' => $this->contact_homepage,
        ]);
    }
public function toArray ( $ request ) : array { $ parent = parent :: toArray ( $ request ) ; return array_merge ( $ parent , [ 'avatar' => $ this -> profileImage ? env ( 'IMAGE_PATH' ) . '/user_profile/small_square/' . $ this -> profileImage -> filename : null , 'email' => $ this -> email , 'gender' => $ this -> gender , 'birthYear' => $ this -> birthyear , 'description' => $ this -> description , 'notify_message' => $ this -> notify_message , 'notify_follow' => $ this -> notify_follow , 'contact_facebook' => $ this -> contact_facebook , 'contact_twitter' => $ this -> contact_twitter , 'contact_instagram' => $ this -> contact_instagram , 'contact_homepage' => $ this -> contact_homepage , ] ) ; }
Transform the resource into an array.
Transform the resource into an array .