Есть такой код:
User::all()->except(['activated', 'activation_code']);
Но почему то поля из массива он не исключает, только в одномерном массиве!
[
{
"id": 1,
"email": "lorem123300@mail.ru",
"permissions": null,
"activated": 1,
"activation_code": null,
"activated_at": null,
"last_login": null,
"persist_code": null,
"reset_password_code": null,
"first_name": "Artem",
"last_name": "Gavrylenko",
"middle_name": "Yuriyovich",
"post": "main",
"wage": "0.00",
"address": "ул. Пушкина 32, кв.12",
"telephone": "+380934317777",
"date_of_birth": "1997-01-17",
"sex": 1,
"api_token": "",
"created_at": "2015-07-26 08:17:53",
"updated_at": "2015-07-26 08:17:53"
},
{
"id": 2,
"email": "art12210@mail.ru",
"permissions": null,
"activated": 1,
"activation_code": null,
"activated_at": null,
"last_login": "2015-07-26 11:37:37",
"persist_code": "$2y$10$Rs0lAWgFGTpSJoNfIy4gmet8rvP.fx\\/tiVyuIzSdlnAC9ieSixdwq",
"reset_password_code": null,
"first_name": null,
"last_name": null,
"middle_name": null,
"post": "",
"wage": "0.00",
"address": "",
"telephone": "",
"date_of_birth": "0000-00-00",
"sex": 0,
"api_token": "0eb9662e88663250b5bccfd06b61b3c12afda40748556562a70c252ea138c845",
"created_at": "2015-07-26 10:42:42",
"updated_at": "2015-07-26 11:37:37"
}
]
Заранее спасибо за ответ :)