combindma/hygraph-api

3.1.0 2024-03-16 00:31 UTC

This package is auto-updated.

Last update: 2024-10-16 01:36:35 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Installation

You can install the package via composer:

composer require combindma/hygraph-api

You can publish the config file with:

php artisan vendor:publish --tag="hygraph-api-config"

This is the contents of the published config file:

return [
        'content_api' => env('HYPGRAPH_CONTENT_API', ''),
        'token' => env('HYPGRAPH_TOKEN', ''),
        'cache_ttl' => env('HYPGRAPH_CACHE_TTL', 60 * 60 * 24 * 30),
];

Usage

use Combindma\HygraphApi\Facades\SeoHelper;
use Combindma\HygraphApi\Facades\HygraphApi;


SeoHelper::homepage(HygraphApi::page('xxxxx'));
SeoHelper::page(HygraphApi::page('xxxx'));

$post = HygraphApi::article($slug);
SeoHelper::article($post);

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.