kotcich
@kotcich
Я скучный.

Eloquent "имя модели"::all() выдает огромный массив в котором и колонки таблицы(которые мне нужны) и куча ненужной инфы. Как исправить?

Элементы таблицы там видны сразу Main, Header, Footer и тд. (Там еще больше, я скопировал чтобы понятно было)
object(Illuminate\Database\Eloquent\Collection)#282 (1) {
  ["items":protected]=>
  array(5) {
    [0]=>
    object(App\Models\Post)#283 (27) {
      ["table":protected]=>
      string(5) "posts"
      ["timestamps"]=>
      bool(false)
      ["connection":protected]=>
      string(5) "mysql"
      ["primaryKey":protected]=>
      string(2) "id"
      ["keyType":protected]=>
      string(3) "int"
      ["incrementing"]=>
      bool(true)
      ["with":protected]=>
      array(0) {
      }
      ["withCount":protected]=>
      array(0) {
      }
      ["perPage":protected]=>
      int(15)
      ["exists"]=>
      bool(true)
      ["wasRecentlyCreated"]=>
      bool(false)
      ["attributes":protected]=>
      array(5) {
        ["id"]=>
        int(2)
        ["title"]=>
        string(6) "Header"
        ["desc"]=>
        string(11) "Header page"
        ["text"]=>
        string(19) "Text of header page"
        ["date"]=>
        string(10) "2020-10-10"
      }
      ["original":protected]=>
      array(5) {
        ["id"]=>
        int(2)
        ["title"]=>
        string(6) "Header"
        ["desc"]=>
        string(11) "Header page"
        ["text"]=>
        string(19) "Text of header page"
        ["date"]=>
        string(10) "2020-10-10"
      }
      ["changes":protected]=>
      array(0) {
      }
      ["casts":protected]=>
      array(0) {
      }
      ["classCastCache":protected]=>
      array(0) {
      }
      ["dates":protected]=>
      array(0) {
      }
      ["dateFormat":protected]=>
      NULL
      ["appends":protected]=>
      array(0) {
      }
      ["dispatchesEvents":protected]=>
      array(0) {
      }
      ["observables":protected]=>
      array(0) {
      }
      ["relations":protected]=>
      array(0) {
      }
      ["touches":protected]=>
      array(0) {
      }
      ["hidden":protected]=>
      array(0) {
      }
      ["visible":protected]=>
      array(0) {
      }
      ["fillable":protected]=>
      array(0) {
      }
      ["guarded":protected]=>
      array(1) {
        [0]=>
        string(1) "*"
      }
    }
    [1]=>
    object(App\Models\Post)#284 (27) {
      ["table":protected]=>
      string(5) "posts"
      ["timestamps"]=>
      bool(false)
      ["connection":protected]=>
      string(5) "mysql"
      ["primaryKey":protected]=>
      string(2) "id"
      ["keyType":protected]=>
      string(3) "int"
      ["incrementing"]=>
      bool(true)
      ["with":protected]=>
      array(0) {
      }
      ["withCount":protected]=>
      array(0) {
      }
      ["perPage":protected]=>
      int(15)
      ["exists"]=>
      bool(true)
      ["wasRecentlyCreated"]=>
      bool(false)
      ["attributes":protected]=>
      array(5) {
        ["id"]=>
        int(5)
        ["title"]=>
        string(5) "Links"
        ["desc"]=>
        string(10) "Links page"
        ["text"]=>
        string(18) "Text of links page"
        ["date"]=>
        string(10) "2019-07-07"
      }
      ["original":protected]=>
      array(5) {
        ["id"]=>
        int(5)
        ["title"]=>
        string(5) "Links"
        ["desc"]=>
        string(10) "Links page"
        ["text"]=>
        string(18) "Text of links page"
        ["date"]=>
        string(10) "2019-07-07"
      }
      ["changes":protected]=>
      array(0) {
      }
  • Вопрос задан
  • 124 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы