小编Moh*_*put的帖子

如何从laravel中的数组中获取键名

我想得到我的表的列名.当我使用model :: all();

Users::all();

Illuminate\Database\Eloquent\Collection Object 
(
    [items:protected] => Array
        (
            [0] => Users Object
                (
                    [table:protected] => users
                    [hidden:protected] => Array
                        (
                            [0] => password
                            [1] => remember_token
                        )

                    [fillable] => Array
                        (
                        )

                    [connection:protected] => 
                    [primaryKey:protected] => id
                    [perPage:protected] => 15
                    [incrementing] => 1
                    [timestamps] => 1
                    [attributes:protected] => Array
                        (
                            [id] => 1
                            [first_name] => Mohammed Saqib
                            [last_name] => Rajput
                            [email] => rajput.saqib@hotmail.com
                            [dob] => 2015-06-18 00:00:00
                            [mobile] => 03006710419
                            [status] => inactive
                        )

                    [original:protected] => Array …
Run Code Online (Sandbox Code Playgroud)

php arrays laravel laravel-4

6
推荐指数
2
解决办法
2万
查看次数

标签 统计

arrays ×1

laravel ×1

laravel-4 ×1

php ×1