@@ -18,40 +18,41 @@ class User extends FleetbaseResource
1818 public function toArray ($ request )
1919 {
2020 $ data = [
21- 'id ' => $ this ->when (Http::isInternalRequest (), $ this ->id , $ this ->public_id ),
22- 'uuid ' => $ this ->when (Http::isInternalRequest (), $ this ->uuid ),
23- 'company_uuid ' => $ this ->when (Http::isInternalRequest (), $ this ->company_uuid ),
24- 'public_id ' => $ this ->when (Http::isInternalRequest (), $ this ->public_id ),
25- 'company ' => $ this ->when (Http::isPublicRequest (), $ this ->company ? $ this ->company ->public_id : null ),
26- 'name ' => $ this ->name ,
27- 'username ' => $ this ->username ,
28- 'email ' => $ this ->email ,
29- 'phone ' => $ this ->phone ,
30- 'country ' => $ this ->country ,
31- 'timezone ' => $ this ->timezone ,
32- 'avatar_url ' => $ this ->avatar_url ,
33- 'meta ' => data_get ($ this , 'meta ' , Utils::createObject ()),
34- 'role ' => $ this ->when (Http::isInternalRequest (), new Role ($ this ->role ), null ),
35- 'policies ' => $ this ->when (Http::isInternalRequest (), Policy::collection ($ this ->policies ), []),
36- 'permissions ' => $ this ->when (Http::isInternalRequest (), $ this ->serializePermissions ($ this ->permissions ), []),
37- 'role_name ' => $ this ->when (Http::isInternalRequest (), $ this ->role ? $ this ->role ->name : null ),
38- 'type ' => $ this ->type ,
39- 'locale ' => $ this ->getLocale (),
40- 'types ' => $ this ->when (Http::isInternalRequest (), $ this ->types ?? []),
41- 'company_name ' => $ this ->when (Http::isInternalRequest (), $ this ->company_name ),
42- 'session_status ' => $ this ->when (Http::isInternalRequest (), $ this ->session_status ),
43- 'is_admin ' => $ this ->when (Http::isInternalRequest (), $ this ->is_admin ),
44- 'is_online ' => $ this ->is_online ,
45- 'ip_address ' => $ this ->ip_address ,
46- 'date_of_birth ' => $ this ->date_of_birth ,
47- 'email_verified_at ' => $ this ->email_verified_at ,
48- 'phone_verified_at ' => $ this ->phone_verified_at ,
49- 'last_seen_at ' => $ this ->last_seen_at ,
50- 'last_login ' => $ this ->last_login ,
51- 'status ' => $ this ->status ,
52- 'slug ' => $ this ->slug ,
53- 'updated_at ' => $ this ->updated_at ,
54- 'created_at ' => $ this ->created_at ,
21+ 'id ' => $ this ->when (Http::isInternalRequest (), $ this ->id , $ this ->public_id ),
22+ 'uuid ' => $ this ->when (Http::isInternalRequest (), $ this ->uuid ),
23+ 'company_uuid ' => $ this ->when (Http::isInternalRequest (), $ this ->company_uuid ),
24+ 'public_id ' => $ this ->when (Http::isInternalRequest (), $ this ->public_id ),
25+ 'company ' => $ this ->when (Http::isPublicRequest (), $ this ->company ? $ this ->company ->public_id : null ),
26+ 'name ' => $ this ->name ,
27+ 'username ' => $ this ->username ,
28+ 'email ' => $ this ->email ,
29+ 'phone ' => $ this ->phone ,
30+ 'country ' => $ this ->country ,
31+ 'timezone ' => $ this ->timezone ,
32+ 'avatar_url ' => $ this ->avatar_url ,
33+ 'meta ' => data_get ($ this , 'meta ' , Utils::createObject ()),
34+ 'role ' => $ this ->when (Http::isInternalRequest (), new Role ($ this ->role ), null ),
35+ 'policies ' => $ this ->when (Http::isInternalRequest (), Policy::collection ($ this ->policies ), []),
36+ 'permissions ' => $ this ->when (Http::isInternalRequest (), $ this ->serializePermissions ($ this ->permissions ), []),
37+ 'role_name ' => $ this ->when (Http::isInternalRequest (), $ this ->role ? $ this ->role ->name : null ),
38+ 'type ' => $ this ->type ,
39+ 'locale ' => $ this ->getLocale (),
40+ 'types ' => $ this ->when (Http::isInternalRequest (), $ this ->types ?? []),
41+ 'company_name ' => $ this ->when (Http::isInternalRequest (), $ this ->company_name ),
42+ 'company_onboarding_completed ' => $ this ->when (Http::isInternalRequest (), $ this ->company_onboarding_completed ),
43+ 'session_status ' => $ this ->when (Http::isInternalRequest (), $ this ->session_status ),
44+ 'is_admin ' => $ this ->when (Http::isInternalRequest (), $ this ->is_admin ),
45+ 'is_online ' => $ this ->is_online ,
46+ 'ip_address ' => $ this ->ip_address ,
47+ 'date_of_birth ' => $ this ->date_of_birth ,
48+ 'email_verified_at ' => $ this ->email_verified_at ,
49+ 'phone_verified_at ' => $ this ->phone_verified_at ,
50+ 'last_seen_at ' => $ this ->last_seen_at ,
51+ 'last_login ' => $ this ->last_login ,
52+ 'status ' => $ this ->status ,
53+ 'slug ' => $ this ->slug ,
54+ 'updated_at ' => $ this ->updated_at ,
55+ 'created_at ' => $ this ->created_at ,
5556 ];
5657
5758 return ResourceTransformerRegistry::transform ($ this ->resource , $ data );
0 commit comments