I got to ask why do you need to access the component properties?
You can access the parameter ':slug' $this->param('slug');
.
This should work for you to get the array of properties.
function onStart() {
$this['properties'] = collect($this->page->components['blogPosts'])->last()['postsPerPage'];
}
I am adding another way to get the properties from the array. I am assuming that properties is probably always last but if it isn't:
$array = collect($this->page->components['blogPosts'])->toArray();
$properties = [];
foreach ( $array as $key => $property) {
if ( strpos($key, 'properties') !== false ) {
$properties[$key] = $property;
}
}
$this['properties'] = $properties['postsPerPage'];