0

我有一个来自dreamfactory 的输出,即使用 laravel.Follwing 是来自 api 的数组响应。

DreamFactory\Core\Models\NonAdminUser Object

( [table:protected] => user [fillable:protected] => Array ( [0] => name [1] => username [2] => first_name [3] => last_name [4] => email [5 ] => is_active [6] => 电话 [7] => security_question [8] => security_answer [9] => adldap [10] => oauth_provider [11] => last_login_date [12] => default_app_id)

[rules:protected] => Array
    (
        [name] => required|max:255
        [email] => required|email|max:255
        [username] => min:6|unique:user,username|regex:/^\S*$/u|nullable
    )

[appends:protected] => Array
    (
        [0] => confirmed
        [1] => expired
    )

[hidden:protected] => Array
    (
        [0] => is_sys_admin
        [1] => password
        [2] => remember_token
        [3] => security_answer
    )

[casts:protected] => Array
    (
        [is_active] => boolean
        [is_sys_admin] => boolean
        [id] => integer
    )

[schemaExtension:protected] => 
[connection:protected] => mysql
[primaryKey:protected] => id
[keyType:protected] => int
[incrementing] => 1
[with:protected] => Array
    (
    )

[perPage:protected] => 15
[exists] => 1
[wasRecentlyCreated] => 
[attributes:protected] => Array
    (
        [id] => 61
        [name] => test1 test1
        [username] => test1@gmail.com
        [first_name] => test1
        [last_name] => test1
        [last_login_date] => 2017-12-07 01:20:39
        [email] => test1@gmail.com
        [password] => $2y$10$xHxN8FR/kHGq6pSY4Xa1NOW9EwmUzgMH2oOmtkhWWkNqSxKMMUhdO
        [is_sys_admin] => 0
        [is_active] => 1
        [phone] => 
        [security_question] => 
        [security_answer] => 
        [confirm_code] => y
        [default_app_id] => 
        [remember_token] => 
        [adldap] => 
        [oauth_provider] => 
        [saml] => 
        [created_date] => 2017-11-27 07:23:56
        [last_modified_date] => 2018-03-21 12:08:20
        [created_by_id] => 1
        [last_modified_by_id] => 1
    )

[original:protected] => Array
    (
        [id] => 61
        [name] => test1 test1
        [username] => test1@gmail.com
        [first_name] => test1
        [last_name] => test1
        [last_login_date] => 2017-12-07 01:20:39
        [email] => test1@gmail.com
        [password] => $2y$10$xHxN8FR/kHGq6pSY4Xa1NOW9EwmUzgMH2oOmtkhWWkNqSxKMMUhdO
        [is_sys_admin] => 0
        [is_active] => 1
        [phone] => 
        [security_question] => 
        [security_answer] => 
        [confirm_code] => y
        [default_app_id] => 
        [remember_token] => 
        [adldap] => 
        [oauth_provider] => 
        [saml] => 
        [created_date] => 2017-11-27 07:23:56
        [last_modified_date] => 2018-03-21 12:08:20
        [created_by_id] => 1
        [last_modified_by_id] => 1
    )

[dates:protected] => Array
    (
    )

[dateFormat:protected] => 
[events:protected] => Array
    (
    )

[observables:protected] => Array
    (
    )

[relations:protected] => Array
    (
        [user_lookup_by_user_id] => Illuminate\Database\Eloquent\Collection Object
            (
                [items:protected] => Array
                    (
                        [0] => DreamFactory\Core\Models\UserLookup Object
                            (
                                [table:protected] => user_lookup
                                [fillable:protected] => Array
                                    (
                                        [0] => user_id
                                        [1] => name
                                        [2] => value
                                        [3] => private
                                        [4] => description
                                    )

                                [casts:protected] => Array
                                    (
                                        [id] => integer
                                        [user_id] => integer
                                        [private] => boolean
                                    )

                                [encrypted:protected] => Array
                                    (
                                        [0] => value
                                    )

                                [schemaExtension:protected] => 
                                [connection:protected] => mysql
                                [primaryKey:protected] => id
                                [keyType:protected] => int
                                [incrementing] => 1
                                [with:protected] => Array
                                    (
                                    )

                                [perPage:protected] => 15
                                [exists] => 1
                                [wasRecentlyCreated] => 
                                [attributes:protected] => Array
                                    (
                                        [id] => 5
                                        [user_id] => 61
                                        [name] => naga
                                        [value] => eyJpdiI6ImZldTVMUzdMd0xZRGZ0TzlGdnpFTnc9PSIsInZhbHVlIjoiM0t5Y3pFMnh2czhxWjhDNk1CcjNkUT09IiwibWFjIjoiMTMwYjI0ZTY4MTA2MDk1MzgwMTIxMjYzY2U4MDE1MDMxMmY4NzI5M2IyMThhYmQwZWM1ZGU5YjNiYzM2MzJlMCJ9
                                        [private] => 0
                                        [description] => 
                                        [created_date] => 2018-03-21 12:08:20
                                        [last_modified_date] => 2018-03-21 12:08:20
                                        [created_by_id] => 
                                        [last_modified_by_id] => 
                                    )

                                [original:protected] => Array
                                    (
                                        [id] => 5
                                        [user_id] => 61
                                        [name] => naga
                                        [value] => eyJpdiI6ImZldTVMUzdMd0xZRGZ0TzlGdnpFTnc9PSIsInZhbHVlIjoiM0t5Y3pFMnh2czhxWjhDNk1CcjNkUT09IiwibWFjIjoiMTMwYjI0ZTY4MTA2MDk1MzgwMTIxMjYzY2U4MDE1MDMxMmY4NzI5M2IyMThhYmQwZWM1ZGU5YjNiYzM2MzJlMCJ9
                                        [private] => 0
                                        [description] => 
                                        [created_date] => 2018-03-21 12:08:20
                                        [last_modified_date] => 2018-03-21 12:08:20
                                        [created_by_id] => 
                                        [last_modified_by_id] => 
                                    )

                                [dates:protected] => Array
                                    (
                                    )

                                [dateFormat:protected] => 
                                [appends:protected] => Array
                                    (
                                    )

                                [events:protected] => Array
                                    (
                                    )

                                [observables:protected] => Array
                                    (
                                    )

                                [relations:protected] => Array
                                    (
                                    )

                                [touches:protected] => Array
                                    (
                                    )

                                [timestamps] => 1
                                [hidden:protected] => Array
                                    (
                                    )

                                [visible:protected] => Array
                                    (
                                    )

                                [guarded:protected] => Array
                                    (
                                        [0] => *
                                    )

                                [cacheTTL:protected] => 0
                                [cachePrefix:protected] => 
                                [cacheKeys:protected] => Array
                                    (
                                    )

                                [protectedView] => 1
                                [protectionMask:protected] => **********
                                [protected:protected] => Array
                                    (
                                    )

                                [encryptedView] => 
                                [rules:protected] => Array
                                    (
                                    )

                                [validationMessages:protected] => Array
                                    (
                                    )

                                [errors:protected] => Array
                                    (
                                    )

                            )

                    )

            )

    )

[touches:protected] => Array
    (
    )

[timestamps] => 1
[visible:protected] => Array
    (
    )

[guarded:protected] => Array
    (
        [0] => *
    )

[cacheTTL:protected] => 0
[cachePrefix:protected] => 
[cacheKeys:protected] => Array
    (
    )

[protectedView] => 1
[protectionMask:protected] => **********
[protected:protected] => Array
    (
    )

[encryptedView] => 
[encrypted:protected] => Array
    (
    )

[validationMessages:protected] => Array
    (
    )

[errors:protected] => Array
    (
    )

[rememberTokenName:protected] => remember_token

如何使用 php 解析 user_lookup_by_user_id 的值

4

0 回答 0