I am working with laravel 5 pagination and getting some problems.
Here is my code DB::table('users')->paginate(2) and it returns an object of LengthAwarePaginator Like this :
Illuminate\Pagination\LengthAwarePaginator Object
(
[total:protected] => 4
[lastPage:protected] => 2
[items:protected] => Illuminate\Support\Collection Object
(
[items:protected] => Array
(
[0] => stdClass Object
(
[id] => 3
[Name] => shivani
[email] => [email protected]
[password] => $2y$10$iD1by60rSBvrMjuqwmYLseNIrd4jmvK8sXUEYiXfDjJVcBD02jEbK
[updated_at] => 2015-04-27 05:17:34
[created_at] => 2015-04-27 05:17:30
[remember_token] => guVL5RdcmRXedSBMsfSZSlCeFPfRjEq8vSNQNjtED2ytBHaPCZ3N8G3dmj6C
)
[1] => stdClass Object
(
[id] => 4
[Name] => shivani
[email] => [email protected]
[password] => $2y$10$iD1by60rSBvrMjuqwmYLseNIrd4jmvK8sXUEYiXfDjJVcBD02jEbK
[updated_at] => 2015-04-27 05:17:34
[created_at] => 2015-04-27 05:17:30
[remember_token] => guVL5RdcmRXedSBMsfSZSlCeFPfRjEq8vSNQNjtED2ytBHaPCZ3N8G3dmj6C
)
)
)
[perPage:protected] => 2
[currentPage:protected] => 1
[path:protected] => http://localhost/shivani/public/check/user-list
[query:protected] => Array
(
)
[fragment:protected] =>
[pageName:protected] => page
)
My problem is that I want to iterate through this object and retrieve items object that holds database data i.e. name , email etc.
But I don't know how to access protected members from the returned object.