$page->toArray($callback = null)
Converts the entire page object into a plain PHP array
-
$callback (closure)
Filter callback -
return (array)
Example
<?php
$array = $page->toArray();
var_dump($array);
With a callback
<?php
$array = $page->toArray(function ($page) {
return [
'id' => $page->id(),
];
});
var_dump($array);