Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 430 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| UserDetailsResource | |
0.00% |
0 / 430 |
|
0.00% |
0 / 2 |
110 | |
0.00% |
0 / 1 |
| toArray | |
0.00% |
0 / 417 |
|
0.00% |
0 / 1 |
2 | |||
| formatDate | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
90 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Resources; |
| 4 | |
| 5 | use Illuminate\Http\Request; |
| 6 | use Illuminate\Support\Carbon; |
| 7 | use Illuminate\Http\Resources\Json\JsonResource; |
| 8 | |
| 9 | class UserDetailsResource extends JsonResource |
| 10 | { |
| 11 | /** |
| 12 | * Transform the resource into an array. |
| 13 | * |
| 14 | * @return array<string, mixed> |
| 15 | */ |
| 16 | public function toArray(Request $request): array |
| 17 | { |
| 18 | return [ |
| 19 | 'first_name' => $this->first_name, |
| 20 | 'last_name' => $this->last_name, |
| 21 | 'full_name' => $this->full_name, |
| 22 | 'email' => $this->email, |
| 23 | 'email_verified_at' => $this->formatDate($this->email_verified_at), |
| 24 | 'job_role' => $this->job_role, |
| 25 | 'department' => $this->department, |
| 26 | 'job_title' => $this->job_title, |
| 27 | 'company' => $this->company, |
| 28 | 'phone' => $this->phone, |
| 29 | 'account_creation_date' => $this->formatDate($this->account_creation_date), |
| 30 | 'linkedin_url' => $this->linkedin_url, |
| 31 | 'user_type' => explode(',', $this->user_type), |
| 32 | 'user_id' => $this->user_id, |
| 33 | 'typed_words_per_minute' => $this->typed_words_per_minute, |
| 34 | 'wage_per_hour' => $this->wage_per_hour, |
| 35 | 'email_used_for_login' => $this->email_used_for_login, |
| 36 | 'signin_source' => $this->signin_source, |
| 37 | 'signup_source' => $this->signup_source, |
| 38 | 'last_login' => $this->formatDate($this->last_login), |
| 39 | 'last_login_fly_learning' => $this->formatDate($this->last_login_fly_learning), |
| 40 | 'status' => $this->status, |
| 41 | 'status_date' => $this->formatDate($this->status_date), |
| 42 | 'user_created_at' => $this->formatDate($this->user_created_at), |
| 43 | 'user_updated_at' => $this->formatDate($this->user_updated_at), |
| 44 | 'company_id' => $this->company_id, |
| 45 | 'company_name' => $this->company_name, |
| 46 | 'avatar' => $this->avatar, |
| 47 | 'hubspot_id' => $this->hubspot_id, |
| 48 | 'stripe_id' => $this->stripe_id, |
| 49 | 'instancy_id' => $this->instancy_id, |
| 50 | 'group_id' => $this->group_id, |
| 51 | 'group_name' => $this->group_name, |
| 52 | 'subgroup_id' => $this->subgroup_id, |
| 53 | 'subgroup_name' => $this->subgroup_name, |
| 54 | // 'role_ids' => $this->role_ids, |
| 55 | 'role_names' => explode(',', $this->role_names), |
| 56 | 'is_invite' => $this->is_invite, |
| 57 | // 'email_domain' => $this->email_domain, |
| 58 | // 'email_domain_count' => $this->email_domain_count, |
| 59 | 'is_any_extension_installed' => $this->is_any_extension_installed, |
| 60 | 'is_any_extension_uninstalled' => $this->is_any_extension_uninstalled, |
| 61 | 'signed_into_flymsg_extension' => $this->signed_into_flymsg_extension, |
| 62 | 'which_browser_has_an_extension_been_installed_on' => explode(';', $this->which_browser_has_an_extension_been_installed_on), |
| 63 | 'last_browser_used' => $this->last_browser_used, |
| 64 | 'total_time_saved_by_flymsg_by_user' => $this->total_time_saved_by_flymsg_by_user, |
| 65 | 'total_time_saved_summarized_monthly_by_flymsg_by_user' => $this->total_time_saved_summarized_monthly_by_flymsg_by_user, |
| 66 | 'total_cost_savings_by_flymsg_by_user' => $this->total_cost_savings_by_flymsg_by_user, |
| 67 | 'total_cost_savings_summarized_monthly_by_flymsg_by_user' => $this->total_cost_savings_summarized_monthly_by_flymsg_by_user, |
| 68 | 'total___of_characters_typed_by_flymsg_by_user' => $this->total___of_characters_typed_by_flymsg_by_user, |
| 69 | 'total___of_characters_typed_monthly_by_flymsg_by_user' => $this->total___of_characters_typed_monthly_by_flymsg_by_user, |
| 70 | 'last_date_user_used_a_flycut' => $this->formatDate($this->last_date_user_used_a_flycut), |
| 71 | 'number_of_categories_created_last_date' => $this->formatDate($this->number_of_categories_created_last_date), |
| 72 | 'number_of_categories_created_count' => $this->number_of_categories_created_count, |
| 73 | 'number_of_flycuts_created_last_date' => $this->formatDate($this->number_of_flycuts_created_last_date), |
| 74 | 'number_of_flycuts_created_count' => $this->number_of_flycuts_created_count, |
| 75 | 'number_of_flyplates_in_flycuts_last_date' => $this->formatDate($this->number_of_flyplates_in_flycuts_last_date), |
| 76 | 'number_of_flyplates_in_flycuts_count' => $this->number_of_flyplates_in_flycuts_count, |
| 77 | 'clicked_help_last_date' => $this->formatDate($this->clicked_help_last_date), |
| 78 | 'clicked_help_count' => $this->clicked_help_count, |
| 79 | 'clicked_settings_last_date' => $this->formatDate($this->clicked_settings_last_date), |
| 80 | 'clicked_settings_count' => $this->clicked_settings_count, |
| 81 | 'clicked_download_extension_last_date' => $this->formatDate($this->clicked_download_extension_last_date), |
| 82 | 'clicked_download_extension_count' => $this->clicked_download_extension_count, |
| 83 | 'clicked_contact_sales_last_date' => $this->formatDate($this->clicked_contact_sales_last_date), |
| 84 | 'clicked_contact_sales_count' => $this->clicked_contact_sales_count, |
| 85 | 'df_stripe_customer_id' => $this->df_stripe_customer_id, |
| 86 | 'subscription_owner' => $this->subscription_owner, |
| 87 | 'billing_address_line_1' => $this->billing_address_line_1, |
| 88 | 'billing_address_line_2' => $this->billing_address_line_2, |
| 89 | 'billing_city' => $this->billing_city, |
| 90 | 'billing_state' => $this->billing_state, |
| 91 | 'billing_zip' => $this->billing_zip, |
| 92 | 'billing_country' => $this->billing_country, |
| 93 | 'number_of_completed_payments' => $this->number_of_completed_payments, |
| 94 | 'number_of_expected_payments' => $this->number_of_expected_payments, |
| 95 | 'payment_method' => $this->payment_method, |
| 96 | 'flymsg_last_product_purchased' => $this->flymsg_last_product_purchased, |
| 97 | 'last_total_invoice_amount' => $this->last_total_invoice_amount, |
| 98 | 'flymsg_total_sales' => $this->flymsg_total_sales, |
| 99 | 'coupon_name' => $this->coupon_name, |
| 100 | 'coupon_code' => $this->coupon_code, |
| 101 | 'coupon_type' => $this->coupon_type, |
| 102 | 'duration' => $this->duration, |
| 103 | 'coupon_value__discount_' => $this->coupon_value__discount_, |
| 104 | 'coupon_redemption_limits' => $this->coupon_redemption_limits, |
| 105 | 'productivity_problems' => $this->productivity_problems, |
| 106 | 'type_here_how_flymsg_will_help_you___' => $this->type_here_how_flymsg_will_help_you___, |
| 107 | 'flymsg_use_case' => $this->flymsg_use_case, |
| 108 | 'sign_out_reason' => $this->sign_out_reason, |
| 109 | 'sign_out_text' => $this->sign_out_text, |
| 110 | 'subscription_type' => $this->subscription_type, |
| 111 | 'plan_id' => $this->plan_id, |
| 112 | 'plan_name' => $this->plan_name, |
| 113 | 'is_chrome_extension_installed' => $this->is_chrome_extension_installed, |
| 114 | 'is_chrome_extension_uninstalled' => $this->is_chrome_extension_uninstalled, |
| 115 | 'flymsg_chrome_extension_installed__date_' => $this->formatDate($this->flymsg_chrome_extension_installed__date_), |
| 116 | 'flymsg_chrome_extension_uninstalled__date_' => $this->formatDate($this->flymsg_chrome_extension_uninstalled__date_), |
| 117 | 'flymsg_extension_version_for_chrome' => $this->flymsg_extension_version_for_chrome, |
| 118 | 'is_edge_extension_installed' => $this->is_edge_extension_installed, |
| 119 | 'is_edge_extension_uninstalled' => $this->is_edge_extension_uninstalled, |
| 120 | 'flymsg_edge_extension_installed__date_' => $this->formatDate($this->flymsg_edge_extension_installed__date_), |
| 121 | 'flymsg_edge_extension_uninstalled__date_' => $this->formatDate($this->flymsg_edge_extension_uninstalled__date_), |
| 122 | 'flymsg_extension_version_for_edge' => $this->flymsg_extension_version_for_edge, |
| 123 | 'flymsg_freemium_subscription_status' => $this->flymsg_freemium_subscription_status, |
| 124 | 'freemium_subscription_start_date' => $this->formatDate($this->freemium_subscription_start_date), |
| 125 | 'freemium_subscription_status_updated_on' => $this->formatDate($this->freemium_subscription_status_updated_on), |
| 126 | 'freemium_subscription_churn_date' => $this->formatDate($this->freemium_subscription_churn_date), |
| 127 | 'freemium_cancel_subscription_date' => $this->formatDate($this->freemium_cancel_subscription_date), |
| 128 | 'starter_payment_status' => $this->starter_payment_status, |
| 129 | 'flymsg_starter_subscription_status' => $this->flymsg_starter_subscription_status, |
| 130 | 'starter_subscription_status_updated_on' => $this->formatDate($this->starter_subscription_status_updated_on), |
| 131 | 'starter_subscription_start_date' => $this->formatDate($this->starter_subscription_start_date), |
| 132 | 'flymsg_starter_subscription_frequency' => $this->flymsg_starter_subscription_frequency, |
| 133 | 'starter_subscription_expiration_date' => $this->formatDate($this->starter_subscription_expiration_date), |
| 134 | 'starter_cancel_subscription_date' => $this->formatDate($this->starter_cancel_subscription_date), |
| 135 | 'starter_subscription_churn_date' => $this->formatDate($this->starter_subscription_churn_date), |
| 136 | 'flymsg_starter_subscription_monthly_recurring_revenue' => $this->flymsg_starter_subscription_monthly_recurring_revenue, |
| 137 | 'flymsg_starter_subscription_annual_recurring_revenue' => $this->flymsg_starter_subscription_annual_recurring_revenue, |
| 138 | 'growth_payment_status' => $this->growth_payment_status, |
| 139 | 'flymsg_growth_subscription_status' => $this->flymsg_growth_subscription_status, |
| 140 | 'growth_subscription_status_updated_on' => $this->formatDate($this->growth_subscription_status_updated_on), |
| 141 | 'growth_subscription_start_date' => $this->formatDate($this->growth_subscription_start_date), |
| 142 | 'flymsg_growth_subscription_frequency' => $this->flymsg_growth_subscription_frequency, |
| 143 | 'growth_subscription_expiration_date' => $this->formatDate($this->growth_subscription_expiration_date), |
| 144 | 'growth_cancel_subscription_date' => $this->formatDate($this->growth_cancel_subscription_date), |
| 145 | 'growth_subscription_churn_date' => $this->formatDate($this->growth_subscription_churn_date), |
| 146 | 'flymsg_growth_subscription_monthly_recurring_revenue' => $this->flymsg_growth_subscription_monthly_recurring_revenue, |
| 147 | 'growth_subscription_annual_recurring_revenue' => $this->growth_subscription_annual_recurring_revenue, |
| 148 | 'professional_payment_status' => $this->professional_payment_status, |
| 149 | 'professional_subscription_status' => $this->professional_subscription_status, |
| 150 | 'trail_period_start_date' => $this->formatDate($this->trail_period_start_date), |
| 151 | 'trail_period_end_date' => $this->formatDate($this->trail_period_end_date), |
| 152 | 'trail_period_canceled_date' => $this->formatDate($this->trail_period_canceled_date), |
| 153 | 'professional_subscription_status_updated_on' => $this->formatDate($this->professional_subscription_status_updated_on), |
| 154 | 'professional_subscription_start_date' => $this->formatDate($this->professional_subscription_start_date), |
| 155 | 'professional_subscription_frequency' => $this->professional_subscription_frequency, |
| 156 | 'professional_subscription_expiration_date' => $this->formatDate($this->professional_subscription_expiration_date), |
| 157 | 'professional_cancel_subscription_date' => $this->formatDate($this->professional_cancel_subscription_date), |
| 158 | 'professional_subscription_churn_date' => $this->formatDate($this->professional_subscription_churn_date), |
| 159 | 'professional_subscription_monthly_recurring_revenue' => $this->professional_subscription_monthly_recurring_revenue, |
| 160 | 'professional_subscription_annual_recurring_revenue' => $this->professional_subscription_annual_recurring_revenue, |
| 161 | 'sales_pro_teams_subscription_status' => $this->sales_pro_teams_subscription_status, |
| 162 | 'sales_pro_teams_subscription_status_updated_on' => $this->formatDate($this->formatDate($this->sales_pro_teams_subscription_status_updated_on)), |
| 163 | 'sales_pro_teams_subscription_start_date' => $this->formatDate($this->sales_pro_teams_subscription_start_date), |
| 164 | 'sales_pro_teams_subscription_frequency' => $this->sales_pro_teams_subscription_frequency, |
| 165 | 'sales_pro_teams_subscription_expiration_date' => $this->formatDate($this->sales_pro_teams_subscription_expiration_date), |
| 166 | 'sales_pro_teams_cancel_subscription_date' => $this->formatDate($this->sales_pro_teams_cancel_subscription_date), |
| 167 | 'sales_pro_teams_subscription_churn_date' => $this->formatDate($this->sales_pro_teams_subscription_churn_date), |
| 168 | 'sales_pro_teams_subscription_plan_type' => $this->sales_pro_teams_subscription_plan_type, |
| 169 | 'sales_pro_teams_user_type' => $this->sales_pro_teams_user_type, |
| 170 | 'deleted_at' => $this->formatDate($this->deleted_at), |
| 171 | 'created_at' => $this->formatDate($this->created_at), |
| 172 | 'updated_at' => $this->formatDate($this->updated_at), |
| 173 | 'total___of_times_flygrammar_is_used_summarized_monthly_by_user__count_' => $this->total___of_times_flygrammar_is_used_summarized_monthly_by_user__count_, |
| 174 | 'total___of_times_flygrammar_used__count_' => $this->total___of_times_flygrammar_used__count_, |
| 175 | 'last_date_user_used_flygrammar' => $this->formatDate($this->last_date_user_used_flygrammar), |
| 176 | 'total___of_times_flyposts_is_used_summarized_monthly_by_user__count_' => $this->total___of_times_flyposts_is_used_summarized_monthly_by_user__count_, |
| 177 | 'last_date_user_used_flyposts' => $this->formatDate($this->last_date_user_used_flyposts), |
| 178 | 'total___of_times_flyposts_used__count_' => $this->total___of_times_flyposts_used__count_, |
| 179 | 'total___of_times_flyengage_is_used_summarized_monthly_by_user' => $this->total___of_times_flyengage_is_used_summarized_monthly_by_user, |
| 180 | 'last_date_user_used_flyengage' => $this->formatDate($this->last_date_user_used_flyengage), |
| 181 | 'total___of_times_flyengage_used__count_' => $this->total___of_times_flyengage_used__count_, |
| 182 | 'total___of_times_sentence_rewrite_is_used_summarized_monthly_by_user' => $this->total___of_times_sentence_rewrite_is_used_summarized_monthly_by_user, |
| 183 | 'last_date_user_used_sentence_rewrite' => $this->formatDate($this->last_date_user_used_sentence_rewrite), |
| 184 | 'total___of_times_sentence_rewrite_used__count_' => $this->total___of_times_sentence_rewrite_used__count_, |
| 185 | 'total___of_times_paragraph_rewrite_is_used_summarized_monthly_by_user' => $this->total___of_times_paragraph_rewrite_is_used_summarized_monthly_by_user, |
| 186 | 'last_date_user_used_paragraph_rewrite' => $this->formatDate($this->last_date_user_used_paragraph_rewrite), |
| 187 | 'total___of_times_paragraph_rewrite_used__count_' => $this->total___of_times_paragraph_rewrite_used__count_, |
| 188 | |
| 189 | 'total___of_times_flycut_used__count_' => $this->total___of_times_flycut_used__count_, |
| 190 | |
| 191 | 'summary_2022' => [ |
| 192 | 'january' => [ |
| 193 | 'total_time_saved' => $this->total_time_saved___january_2022, |
| 194 | 'total_cost_savings' => $this->total_cost_savings___january_2022, |
| 195 | 'of_characters_typed' => $this->of_characters_typed___january_2022, |
| 196 | ], |
| 197 | 'february' => [ |
| 198 | 'total_time_saved' => $this->total_time_saved___february_2022, |
| 199 | 'total_cost_savings' => $this->total_cost_savings___february_2022, |
| 200 | 'of_characters_typed' => $this->of_characters_typed___february_2022, |
| 201 | ], |
| 202 | 'march' => [ |
| 203 | 'total_time_saved' => $this->total_time_saved___march_2022, |
| 204 | 'total_cost_savings' => $this->total_cost_savings___march_2022, |
| 205 | 'of_characters_typed' => $this->of_characters_typed___march_2022, |
| 206 | ], |
| 207 | 'april' => [ |
| 208 | 'total_time_saved' => $this->total_time_saved___april_2022, |
| 209 | 'total_cost_savings' => $this->total_cost_savings___april_2022, |
| 210 | 'of_characters_typed' => $this->of_characters_typed___april_2022, |
| 211 | ], |
| 212 | 'may' => [ |
| 213 | 'total_time_saved' => $this->total_time_saved___may_2022, |
| 214 | 'total_cost_savings' => $this->total_cost_savings___may_2022, |
| 215 | 'of_characters_typed' => $this->of_characters_typed___may_2022, |
| 216 | ], |
| 217 | 'june' => [ |
| 218 | 'total_time_saved' => $this->total_time_saved___june_2022, |
| 219 | 'total_cost_savings' => $this->total_cost_savings___june_2022, |
| 220 | 'of_characters_typed' => $this->of_characters_typed___june_2022, |
| 221 | ], |
| 222 | 'july' => [ |
| 223 | 'total_time_saved' => $this->total_time_saved___july_2022, |
| 224 | 'total_cost_savings' => $this->total_cost_savings___july_2022, |
| 225 | 'of_characters_typed' => $this->of_characters_typed___july_2022, |
| 226 | ], |
| 227 | 'august' => [ |
| 228 | 'total_time_saved' => $this->total_time_saved___august_2022, |
| 229 | 'total_cost_savings' => $this->total_cost_savings___august_2022, |
| 230 | 'of_characters_typed' => $this->of_characters_typed___august_2022, |
| 231 | ], |
| 232 | 'september' => [ |
| 233 | 'total_time_saved' => $this->total_time_saved___september_2022, |
| 234 | 'total_cost_savings' => $this->total_cost_savings___september_2022, |
| 235 | 'of_characters_typed' => $this->of_characters_typed___september_2022, |
| 236 | ], |
| 237 | 'october' => [ |
| 238 | 'total_time_saved' => $this->total_time_saved___october_2022, |
| 239 | 'total_cost_savings' => $this->total_cost_savings___october_2022, |
| 240 | 'of_characters_typed' => $this->of_characters_typed___october_2022, |
| 241 | ], |
| 242 | 'november' => [ |
| 243 | 'total_time_saved' => $this->total_time_saved___november_2022, |
| 244 | 'total_cost_savings' => $this->total_cost_savings___november_2022, |
| 245 | 'of_characters_typed' => $this->of_characters_typed___november_2022, |
| 246 | ], |
| 247 | 'december' => [ |
| 248 | 'total_time_saved' => $this->total_time_saved___december_2022, |
| 249 | 'total_cost_savings' => $this->total_cost_savings___december_2022, |
| 250 | 'of_characters_typed' => $this->of_characters_typed___december_2022, |
| 251 | ], |
| 252 | ], |
| 253 | 'summary_2023' => [ |
| 254 | 'january' => [ |
| 255 | 'total_time_saved' => $this->total_time_saved___january_2023, |
| 256 | 'total_cost_savings' => $this->total_cost_savings___january_2023, |
| 257 | 'of_characters_typed' => $this->of_characters_typed___january_2023, |
| 258 | ], |
| 259 | 'february' => [ |
| 260 | 'total_time_saved' => $this->total_time_saved___february_2023, |
| 261 | 'total_cost_savings' => $this->total_cost_savings___february_2023, |
| 262 | 'of_characters_typed' => $this->of_characters_typed___february_2023, |
| 263 | ], |
| 264 | 'march' => [ |
| 265 | 'total_time_saved' => $this->total_time_saved___march_2023, |
| 266 | 'total_cost_savings' => $this->total_cost_savings___march_2023, |
| 267 | 'of_characters_typed' => $this->of_characters_typed___march_2023, |
| 268 | ], |
| 269 | 'april' => [ |
| 270 | 'total_time_saved' => $this->total_time_saved___april_2023, |
| 271 | 'total_cost_savings' => $this->total_cost_savings___april_2023, |
| 272 | 'of_characters_typed' => $this->of_characters_typed___april_2023, |
| 273 | ], |
| 274 | 'may' => [ |
| 275 | 'total_time_saved' => $this->total_time_saved___may_2023, |
| 276 | 'total_cost_savings' => $this->total_cost_savings___may_2023, |
| 277 | 'of_characters_typed' => $this->of_characters_typed___may_2023, |
| 278 | ], |
| 279 | 'june' => [ |
| 280 | 'total_time_saved' => $this->total_time_saved___june_2023, |
| 281 | 'total_cost_savings' => $this->total_cost_savings___june_2023, |
| 282 | 'of_characters_typed' => $this->of_characters_typed___june_2023, |
| 283 | ], |
| 284 | 'july' => [ |
| 285 | 'total_time_saved' => $this->total_time_saved___july_2023, |
| 286 | 'total_cost_savings' => $this->total_cost_savings___july_2023, |
| 287 | 'of_characters_typed' => $this->of_characters_typed___july_2023, |
| 288 | ], |
| 289 | 'august' => [ |
| 290 | 'total_time_saved' => $this->total_time_saved___august_2023, |
| 291 | 'total_cost_savings' => $this->total_cost_savings___august_2023, |
| 292 | 'of_characters_typed' => $this->of_characters_typed___august_2023, |
| 293 | ], |
| 294 | 'september' => [ |
| 295 | 'total_time_saved' => $this->total_time_saved___september_2023, |
| 296 | 'total_cost_savings' => $this->total_cost_savings___september_2023, |
| 297 | 'of_characters_typed' => $this->of_characters_typed___september_2023, |
| 298 | ], |
| 299 | 'october' => [ |
| 300 | 'total_time_saved' => $this->total_time_saved___october_2023, |
| 301 | 'total_cost_savings' => $this->total_cost_savings___october_2023, |
| 302 | 'of_characters_typed' => $this->of_characters_typed___october_2023, |
| 303 | ], |
| 304 | 'november' => [ |
| 305 | 'total_time_saved' => $this->total_time_saved___november_2023, |
| 306 | 'total_cost_savings' => $this->total_cost_savings___november_2023, |
| 307 | 'of_characters_typed' => $this->of_characters_typed___november_2023, |
| 308 | ], |
| 309 | 'december' => [ |
| 310 | 'total_time_saved' => $this->total_time_saved___december_2023, |
| 311 | 'total_cost_savings' => $this->total_cost_savings___december_2023, |
| 312 | 'of_characters_typed' => $this->of_characters_typed___december_2023, |
| 313 | ], |
| 314 | ], |
| 315 | 'summary_2024' => [ |
| 316 | 'january' => [ |
| 317 | 'total_time_saved' => $this->total_time_saved___january_2024, |
| 318 | 'total_cost_savings' => $this->total_cost_savings___january_2024, |
| 319 | 'of_characters_typed' => $this->of_characters_typed___january_2024, |
| 320 | ], |
| 321 | 'february' => [ |
| 322 | 'total_time_saved' => $this->total_time_saved___february_2024, |
| 323 | 'total_cost_savings' => $this->total_cost_savings___february_2024, |
| 324 | 'of_characters_typed' => $this->of_characters_typed___february_2024, |
| 325 | ], |
| 326 | 'march' => [ |
| 327 | 'total_time_saved' => $this->total_time_saved___march_2024, |
| 328 | 'total_cost_savings' => $this->total_cost_savings___march_2024, |
| 329 | 'of_characters_typed' => $this->of_characters_typed___march_2024, |
| 330 | ], |
| 331 | 'april' => [ |
| 332 | 'total_time_saved' => $this->total_time_saved___april_2024, |
| 333 | 'total_cost_savings' => $this->total_cost_savings___april_2024, |
| 334 | 'of_characters_typed' => $this->of_characters_typed___april_2024, |
| 335 | ], |
| 336 | 'may' => [ |
| 337 | 'total_time_saved' => $this->total_time_saved___may_2024, |
| 338 | 'total_cost_savings' => $this->total_cost_savings___may_2024, |
| 339 | 'of_characters_typed' => $this->of_characters_typed___may_2024, |
| 340 | ], |
| 341 | 'june' => [ |
| 342 | 'total_time_saved' => $this->total_time_saved___june_2024, |
| 343 | 'total_cost_savings' => $this->total_cost_savings___june_2024, |
| 344 | 'of_characters_typed' => $this->of_characters_typed___june_2024, |
| 345 | ], |
| 346 | 'july' => [ |
| 347 | 'total_time_saved' => $this->total_time_saved___july_2024, |
| 348 | 'total_cost_savings' => $this->total_cost_savings___july_2024, |
| 349 | 'of_characters_typed' => $this->of_characters_typed___july_2024, |
| 350 | ], |
| 351 | 'august' => [ |
| 352 | 'total_time_saved' => $this->total_time_saved___august_2024, |
| 353 | 'total_cost_savings' => $this->total_cost_savings___august_2024, |
| 354 | 'of_characters_typed' => $this->of_characters_typed___august_2024, |
| 355 | ], |
| 356 | 'september' => [ |
| 357 | 'total_time_saved' => $this->total_time_saved___september_2024, |
| 358 | 'total_cost_savings' => $this->total_cost_savings___september_2024, |
| 359 | 'of_characters_typed' => $this->of_characters_typed___september_2024, |
| 360 | ], |
| 361 | 'october' => [ |
| 362 | 'total_time_saved' => $this->total_time_saved___october_2024, |
| 363 | 'total_cost_savings' => $this->total_cost_savings___october_2024, |
| 364 | 'of_characters_typed' => $this->of_characters_typed___october_2024, |
| 365 | ], |
| 366 | 'november' => [ |
| 367 | 'total_time_saved' => $this->total_time_saved___november_2024, |
| 368 | 'total_cost_savings' => $this->total_cost_savings___november_2024, |
| 369 | 'of_characters_typed' => $this->of_characters_typed___november_2024, |
| 370 | ], |
| 371 | 'december' => [ |
| 372 | 'total_time_saved' => $this->total_time_saved___december_2024, |
| 373 | 'total_cost_savings' => $this->total_cost_savings___december_2024, |
| 374 | 'of_characters_typed' => $this->of_characters_typed___december_2024, |
| 375 | ], |
| 376 | ], |
| 377 | 'summary_2025' => [ |
| 378 | 'january' => [ |
| 379 | 'total_time_saved' => $this->total_time_saved___january_2025, |
| 380 | 'total_cost_savings' => $this->total_cost_savings___january_2025, |
| 381 | 'of_characters_typed' => $this->of_characters_typed___january_2025, |
| 382 | ], |
| 383 | 'february' => [ |
| 384 | 'total_time_saved' => $this->total_time_saved___february_2025, |
| 385 | 'total_cost_savings' => $this->total_cost_savings___february_2025, |
| 386 | 'of_characters_typed' => $this->of_characters_typed___february_2025, |
| 387 | ], |
| 388 | 'march' => [ |
| 389 | 'total_time_saved' => $this->total_time_saved___march_2025, |
| 390 | 'total_cost_savings' => $this->total_cost_savings___march_2025, |
| 391 | 'of_characters_typed' => $this->of_characters_typed___march_2025, |
| 392 | ], |
| 393 | 'april' => [ |
| 394 | 'total_time_saved' => $this->total_time_saved___april_2025, |
| 395 | 'total_cost_savings' => $this->total_cost_savings___april_2025, |
| 396 | 'of_characters_typed' => $this->of_characters_typed___april_2025, |
| 397 | ], |
| 398 | 'may' => [ |
| 399 | 'total_time_saved' => $this->total_time_saved___may_2025, |
| 400 | 'total_cost_savings' => $this->total_cost_savings___may_2025, |
| 401 | 'of_characters_typed' => $this->of_characters_typed___may_2025, |
| 402 | ], |
| 403 | 'june' => [ |
| 404 | 'total_time_saved' => $this->total_time_saved___june_2025, |
| 405 | 'total_cost_savings' => $this->total_cost_savings___june_2025, |
| 406 | 'of_characters_typed' => $this->of_characters_typed___june_2025, |
| 407 | ], |
| 408 | 'july' => [ |
| 409 | 'total_time_saved' => $this->total_time_saved___july_2025, |
| 410 | 'total_cost_savings' => $this->total_cost_savings___july_2025, |
| 411 | 'of_characters_typed' => $this->of_characters_typed___july_2025, |
| 412 | ], |
| 413 | 'august' => [ |
| 414 | 'total_time_saved' => $this->total_time_saved___august_2025, |
| 415 | 'total_cost_savings' => $this->total_cost_savings___august_2025, |
| 416 | 'of_characters_typed' => $this->of_characters_typed___august_2025, |
| 417 | ], |
| 418 | 'september' => [ |
| 419 | 'total_time_saved' => $this->total_time_saved___september_2025, |
| 420 | 'total_cost_savings' => $this->total_cost_savings___september_2025, |
| 421 | 'of_characters_typed' => $this->of_characters_typed___september_2025, |
| 422 | ], |
| 423 | 'october' => [ |
| 424 | 'total_time_saved' => $this->total_time_saved___october_2025, |
| 425 | 'total_cost_savings' => $this->total_cost_savings___october_2025, |
| 426 | 'of_characters_typed' => $this->of_characters_typed___october_2025, |
| 427 | ], |
| 428 | 'november' => [ |
| 429 | 'total_time_saved' => $this->total_time_saved___november_2025, |
| 430 | 'total_cost_savings' => $this->total_cost_savings___november_2025, |
| 431 | 'of_characters_typed' => $this->of_characters_typed___november_2025, |
| 432 | ], |
| 433 | 'december' => [ |
| 434 | 'total_time_saved' => $this->total_time_saved___december_2025, |
| 435 | 'total_cost_savings' => $this->total_cost_savings___december_2025, |
| 436 | 'of_characters_typed' => $this->of_characters_typed___december_2025, |
| 437 | ], |
| 438 | ], |
| 439 | ]; |
| 440 | } |
| 441 | |
| 442 | private function formatDate($value): ?string |
| 443 | { |
| 444 | if (empty($value)) { |
| 445 | return ''; |
| 446 | } |
| 447 | |
| 448 | if ($value instanceof Carbon) { |
| 449 | return $value->format('m/d/y H:i:s'); |
| 450 | } |
| 451 | |
| 452 | if ($value instanceof \MongoDB\BSON\UTCDateTime || (is_numeric($value) && strlen($value) >= 13)) { |
| 453 | try { |
| 454 | return Carbon::createFromTimestampMs($value)->format('m/d/y H:i:s'); |
| 455 | } catch (\Exception $e) { |
| 456 | return null; |
| 457 | } |
| 458 | } |
| 459 | |
| 460 | try { |
| 461 | return Carbon::parse($value)->format('m/d/y H:i:s'); |
| 462 | } catch (\Exception $e) { |
| 463 | try { |
| 464 | return Carbon::createFromTimestamp($value)->format('m/d/y H:i:s'); |
| 465 | } catch (\Exception $e) { |
| 466 | return $value; |
| 467 | } |
| 468 | } |
| 469 | } |
| 470 | } |