Require the package in your composer.json
composer require omatech/editora-astro-resource
Set the configuration option in config/editora.php
'astroToken' => 'hash'
The endpoint is predefined to obtain all published routes. Use the token to authenticate.
Headers: { astro-token: hash }
POST: /api/astro/routes
Use AstroResource in controllers to extract data and return it as a response.
return AstroResource::resources(
HomeExtraction::find($this->inst_id, $this->preview),
GlobalExtraction::find(2, $this->preview),
[
'breadcrumbs' => PageExtraction::getBreadcrumbs($this->inst_id, $this->preview)
]
);