omatech/editora-astro-resource

Installs: 462

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 7

Forks: 0

Open Issues: 0

pkg:composer/omatech/editora-astro-resource

dev-edge 2025-10-03 07:37 UTC

This package is auto-updated.

Last update: 2025-10-03 07:37:42 UTC


README

Installation

Require the package in your composer.json

composer require omatech/editora-astro-resource

Setup configuration

Set the configuration option in config/editora.php

'astroToken' => 'hash'

Using

Get uris

The endpoint is predefined to obtain all published routes. Use the token to authenticate.

Headers: { astro-token: hash }
POST: /api/astro/routes

Get resources

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)
    ]
);