karabinse/fabriq-headless-plugin

Use this package in conjunction with Fabriq CMS for your front end

1.5.0 2024-10-15 12:05 UTC

This package is auto-updated.

Last update: 2024-10-15 12:10:45 UTC


README

Latest Version on Packagist

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.