PHP code example of tomatophp / filament-cms-api

1. Go to this page and download the library: Download tomatophp/filament-cms-api 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/ */

    

tomatophp / filament-cms-api example snippets


->plugin(\TomatoPHP\FilamentCmsApi\FilamentCmsApiPlugin::make())

return [
    'active' => true,              // register the routes
    'prefix' => 'api/cms',
    'middleware' => ['api'],       // add 'auth:sanctum' to make the API private
    'per_page' => 15,
    'max_per_page' => 100,
    'models' => [
        'post' => \TomatoPHP\FilamentCms\Models\Post::class,
        'category' => \TomatoPHP\FilamentCms\Models\Category::class,
    ],
    'resources' => [
        'post' => \TomatoPHP\FilamentCmsApi\Transformers\PostResource::class,
        'category' => \TomatoPHP\FilamentCmsApi\Transformers\CategoryResource::class,
    ],
];
bash
php artisan vendor:publish --tag="filament-cms-api-config"