combindma / hygraph-api
Hygraph Api
3.1.0
2024-03-16 00:31 UTC
Requires
- php: ^8.2
- artesaos/seotools: ^1.0
- gmostafa/php-graphql-client: ^1.13
- illuminate/contracts: ^10.0|^11.0
- spatie/laravel-missing-page-redirector: ^2.9
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.0|^8.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0|^9.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
README
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.