karabinse / fabriq-connector
Fabriq Saloon Connector
Fund package maintenance!
Karabin
1.7.0
2024-11-07 10:48 UTC
Requires
- php: ^8.2
- illuminate/contracts: ^10.0||^11.0
- illuminate/support: ^9.0||^10.0||^11.0
- saloonphp/cache-plugin: ^3.0
- saloonphp/laravel-plugin: ^3.0
- saloonphp/saloon: ^3.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/canvas: ^9.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
README
Installation
You can install the package via composer:
composer require karabinse/fabriq-connector
You can publish the config file with:
php artisan vendor:publish --tag="fabriq-connector-config"
This is the contents of the published config file:
return [ 'base_url' => env('FABRIQ_CONNECTOR_BASE_URL', 'http://localhost'), 'enable_cache' => env('FABRIQ_CONNECTOR_ENABLE_CACHE', false), 'cache_expiry' => env('FABRIQ_CONNECTOR_CACHE_EXPIRY', (3600 * 24) * 7), 'cache_driver' => env('FABRIQ_CONNECTOR_CACHE_STORE', 'file'), 'fabriq_connector_token' => env('FABRIQ_CONNECTOR_TOKEN', ''), ];
Usage
$connector = new FabriqConnector(locale: 'en'); $request = new GetContactsRequest(params: ['include' => 'content']); $response = $connector->send($request); // Response // "data": [ // { // "id": 1, // "locale": "sv", // "name": "Frans Rosander", // "email": "Frans@sten.com", // "phone": "+46 (44) 28 71 11", // "mobile": "+46 (0)702 - 99 09 41", // "published": 1, // "sortindex": 1, // "created_at": "2024-04-11T11:33:17.000000Z", // "updated_at": "2024-05-30T08:18:48.000000Z", // "content": { // "data": { // "body": "", // "position": "", // "image": { // "id": 56, // "file_name": "IMG_5966_FransR.jpg", // "src": "", // "thumb_src": "", // "webp_src": "", // "srcset": "", // "alt_text": "", // "caption": null, // "mime_type": "image\/jpeg", // "size": 23076, // "width": 150, // "height": 187, // "custom_crop": false, // "responsive": "", // "x_position": "50%", // "y_position": "50%", // "meta_id": 13 // }, // "enabled_locales": null // } // } // } // ]
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.