karabinse / fabriq-headless-plugin
Use this package in conjunction with Fabriq CMS for your front end
Fund package maintenance!
Karabin
Requires
- php: ^8.2
- ikoncept/fabriq: ^2.0|dev-main
- illuminate/contracts: ^10.0||^11.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
Common functionality that is needed in most projects connnected to Fabriq CMS
Installation
You can install the package via composer:
composer require karabinse/fabriq-headless-plugin
Usage
Register the controllers to setup your API endpoints to be consumed by your front end.
// ... use Karabin\FabriqPlugin\Http\Controllers\ContactController; // ... // News Route::get('news', [NewsController::class, 'index']); Route::get('news/{id}', [NewsController::class, 'show']); // Contacts Route::get('contacts', [ContactController::class, 'index']); Route::get('contacts/{id}', [ContactController::class, 'show']); // Menus Route::get('menus', [MenuController::class, 'index']); Route::get('menus/{slug}', [MenuController::class, 'show']); // Pages Route::get('pages/{slug}', [PageController::class, 'show']);
It is possible to include extra data in the response. Check out the transformers for available includes.
HTTP GET
/contacts?include=content,tags
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.