Accessing Object Data in Laravel
I have a question about accessing data in an object; this is the object:
RowCollection #2909 ▼
#heading: array:11 [▼
0 => "account_level_i"
1 => "account_level_ii"
2 => "account_level_iii"
3 => "date"
4 => "transaction_type"
5 => "num"
6 => "name"
7 => "class"
8 => "memodescription"
9 => "split"
10 => "amount"
]
#title: "Profit and Loss Detail"
#items: array:6 [▼
0 => CellCollection #2915 ▼
#title: null
#items: array:11 [▼
"account_level_i" => " Income"
"account_level_ii" => " 4000-1 Life Insurance"
"account_level_iii" => " 4000-1 Life Insurance"
"date" => "05/09/2018"
"transaction_type" => "Deposit"
"num" => null
"name" => "John Hancock"
"class" => "Wealth"
"memodescription" => "JOHN HANCOCK USA AG PREAUTHORIZED ACH CREDIT JOHN HANCOCK USA AGENCYIND 180509"
"split" => "1000-6 People's Bank Checking"
"amount" => 2265.1
]
1 => CellCollection #2919 ▶
2 => CellCollection #2923 ▶
3 => CellCollection #2927 ▶
4 => CellCollection #2931 ▶
5 => CellCollection #2935 ▶
]
I need to access the heading data; I know how to access the items.
laravel laravel-5 laravel-collection
add a comment |
I have a question about accessing data in an object; this is the object:
RowCollection #2909 ▼
#heading: array:11 [▼
0 => "account_level_i"
1 => "account_level_ii"
2 => "account_level_iii"
3 => "date"
4 => "transaction_type"
5 => "num"
6 => "name"
7 => "class"
8 => "memodescription"
9 => "split"
10 => "amount"
]
#title: "Profit and Loss Detail"
#items: array:6 [▼
0 => CellCollection #2915 ▼
#title: null
#items: array:11 [▼
"account_level_i" => " Income"
"account_level_ii" => " 4000-1 Life Insurance"
"account_level_iii" => " 4000-1 Life Insurance"
"date" => "05/09/2018"
"transaction_type" => "Deposit"
"num" => null
"name" => "John Hancock"
"class" => "Wealth"
"memodescription" => "JOHN HANCOCK USA AG PREAUTHORIZED ACH CREDIT JOHN HANCOCK USA AGENCYIND 180509"
"split" => "1000-6 People's Bank Checking"
"amount" => 2265.1
]
1 => CellCollection #2919 ▶
2 => CellCollection #2923 ▶
3 => CellCollection #2927 ▶
4 => CellCollection #2931 ▶
5 => CellCollection #2935 ▶
]
I need to access the heading data; I know how to access the items.
laravel laravel-5 laravel-collection
add a comment |
I have a question about accessing data in an object; this is the object:
RowCollection #2909 ▼
#heading: array:11 [▼
0 => "account_level_i"
1 => "account_level_ii"
2 => "account_level_iii"
3 => "date"
4 => "transaction_type"
5 => "num"
6 => "name"
7 => "class"
8 => "memodescription"
9 => "split"
10 => "amount"
]
#title: "Profit and Loss Detail"
#items: array:6 [▼
0 => CellCollection #2915 ▼
#title: null
#items: array:11 [▼
"account_level_i" => " Income"
"account_level_ii" => " 4000-1 Life Insurance"
"account_level_iii" => " 4000-1 Life Insurance"
"date" => "05/09/2018"
"transaction_type" => "Deposit"
"num" => null
"name" => "John Hancock"
"class" => "Wealth"
"memodescription" => "JOHN HANCOCK USA AG PREAUTHORIZED ACH CREDIT JOHN HANCOCK USA AGENCYIND 180509"
"split" => "1000-6 People's Bank Checking"
"amount" => 2265.1
]
1 => CellCollection #2919 ▶
2 => CellCollection #2923 ▶
3 => CellCollection #2927 ▶
4 => CellCollection #2931 ▶
5 => CellCollection #2935 ▶
]
I need to access the heading data; I know how to access the items.
laravel laravel-5 laravel-collection
I have a question about accessing data in an object; this is the object:
RowCollection #2909 ▼
#heading: array:11 [▼
0 => "account_level_i"
1 => "account_level_ii"
2 => "account_level_iii"
3 => "date"
4 => "transaction_type"
5 => "num"
6 => "name"
7 => "class"
8 => "memodescription"
9 => "split"
10 => "amount"
]
#title: "Profit and Loss Detail"
#items: array:6 [▼
0 => CellCollection #2915 ▼
#title: null
#items: array:11 [▼
"account_level_i" => " Income"
"account_level_ii" => " 4000-1 Life Insurance"
"account_level_iii" => " 4000-1 Life Insurance"
"date" => "05/09/2018"
"transaction_type" => "Deposit"
"num" => null
"name" => "John Hancock"
"class" => "Wealth"
"memodescription" => "JOHN HANCOCK USA AG PREAUTHORIZED ACH CREDIT JOHN HANCOCK USA AGENCYIND 180509"
"split" => "1000-6 People's Bank Checking"
"amount" => 2265.1
]
1 => CellCollection #2919 ▶
2 => CellCollection #2923 ▶
3 => CellCollection #2927 ▶
4 => CellCollection #2931 ▶
5 => CellCollection #2935 ▶
]
I need to access the heading data; I know how to access the items.
laravel laravel-5 laravel-collection
laravel laravel-5 laravel-collection
edited Nov 26 '18 at 14:51
Karl Hill
3,17622445
3,17622445
asked Nov 15 '18 at 13:24
Endrit SheholliEndrit Sheholli
157
157
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can use the getAttributes()
method to get a model attributes if that's what you mean.
So if you had the model object in a variable I'm pretty sure you can do $model->getAttributes()
to give you all those headers.
thank you very match sir.
– Endrit Sheholli
Nov 15 '18 at 14:39
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53320490%2faccessing-object-data-in-laravel%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use the getAttributes()
method to get a model attributes if that's what you mean.
So if you had the model object in a variable I'm pretty sure you can do $model->getAttributes()
to give you all those headers.
thank you very match sir.
– Endrit Sheholli
Nov 15 '18 at 14:39
add a comment |
You can use the getAttributes()
method to get a model attributes if that's what you mean.
So if you had the model object in a variable I'm pretty sure you can do $model->getAttributes()
to give you all those headers.
thank you very match sir.
– Endrit Sheholli
Nov 15 '18 at 14:39
add a comment |
You can use the getAttributes()
method to get a model attributes if that's what you mean.
So if you had the model object in a variable I'm pretty sure you can do $model->getAttributes()
to give you all those headers.
You can use the getAttributes()
method to get a model attributes if that's what you mean.
So if you had the model object in a variable I'm pretty sure you can do $model->getAttributes()
to give you all those headers.
answered Nov 15 '18 at 14:21
John HalseyJohn Halsey
898825
898825
thank you very match sir.
– Endrit Sheholli
Nov 15 '18 at 14:39
add a comment |
thank you very match sir.
– Endrit Sheholli
Nov 15 '18 at 14:39
thank you very match sir.
– Endrit Sheholli
Nov 15 '18 at 14:39
thank you very match sir.
– Endrit Sheholli
Nov 15 '18 at 14:39
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53320490%2faccessing-object-data-in-laravel%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown