I have following array
object(Illuminate\Database\Eloquent\Collection)#96 (1) {
["items":protected]=>
array(2) {
[0]=>
object(Answer)#97 (20) {
["connection":protected]=>
NULL
["table":protected]=>
NULL
["primaryKey":protected]=>
string(2) "id"
["perPage":protected]=>
int(15)
["incrementing"]=>
bool(true)
["timestamps"]=>
bool(true)
["attributes":protected]=>
array(6) {
["id"]=>
int(457256)
["question_id"]=>
int(3124)
["user_id"]=>
int(1235)
["answer_text"]=>
string(44) "Sincere Architects Engineers Private Limited"
["created_at"]=>
string(19) "2015-08-10 06:18:06"
["updated_at"]=>
string(19) "2015-08-10 06:39:33"
}
["original":protected]=>
array(6) {
["id"]=>
int(457256)
["question_id"]=>
int(3124)
["user_id"]=>
int(1235)
["answer_text"]=>
string(44) "Sincere Architects Engineers Private Limited"
["created_at"]=>
string(19) "2015-08-10 06:18:06"
["updated_at"]=>
string(19) "2015-08-10 06:39:33"
}
["relations":protected]=>
array(0) {
}
["hidden":protected]=>
array(0) {
}
["visible":protected]=>
array(0) {
}
["appends":protected]=>
array(0) {
}
["fillable":protected]=>
array(0) {
}
["guarded":protected]=>
array(1) {
[0]=>
string(1) "*"
}
["dates":protected]=>
array(0) {
}
["touches":protected]=>
array(0) {
}
["observables":protected]=>
array(0) {
}
["with":protected]=>
array(0) {
}
["morphClass":protected]=>
NULL
["exists"]=>
bool(true)
}
[1]=>
object(Answer)#98 (20) {
["connection":protected]=>
NULL
["table":protected]=>
NULL
["primaryKey":protected]=>
string(2) "id"
["perPage":protected]=>
int(15)
["incrementing"]=>
bool(true)
["timestamps"]=>
bool(true)
["attributes":protected]=>
array(6) {
["id"]=>
int(457257)
["question_id"]=>
int(3125)
["user_id"]=>
int(1235)
["answer_text"]=>
string(14) "Anoop Bartaria"
["created_at"]=>
string(19) "2015-08-10 06:18:06"
["updated_at"]=>
string(19) "2015-08-10 06:39:33"
}
["original":protected]=>
array(6) {
["id"]=>
int(457257)
["question_id"]=>
int(3125)
["user_id"]=>
int(1235)
["answer_text"]=>
string(14) "Anoop Bartaria"
["created_at"]=>
string(19) "2015-08-10 06:18:06"
["updated_at"]=>
string(19) "2015-08-10 06:39:33"
}
["relations":protected]=>
array(0) {
}
["hidden":protected]=>
array(0) {
}
["visible":protected]=>
array(0) {
}
["appends":protected]=>
array(0) {
}
["fillable":protected]=>
array(0) {
}
["guarded":protected]=>
array(1) {
[0]=>
string(1) "*"
}
["dates":protected]=>
array(0) {
}
["touches":protected]=>
array(0) {
}
["observables":protected]=>
array(0) {
}
["with":protected]=>
array(0) {
}
["morphClass":protected]=>
NULL
["exists"]=>
bool(true)
}
}
}
It clearly shows that It has two values that is [0] and [1] but when I
var_dump(array[0])
it says offset error :0
any leads on this one would be appreciated.
Thanks