PHP code example of karabinse / fabriq-headless-plugin

1. Go to this page and download the library: Download karabinse/fabriq-headless-plugin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

karabinse / fabriq-headless-plugin example snippets


// ...
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']);