PHP code example of yusufgenc / filament-api-forge
1. Go to this page and download the library: Download yusufgenc/filament-api-forge 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/ */
yusufgenc / filament-api-forge example snippets
use YusufGenc34\FilamentApiForge\FilamentApiForgePlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugin(
FilamentApiForgePlugin::make()
->apiKeys() // API key management
->docs() // API Docs + Access Control + Settings pages
->dashboard() // Developer Center dashboard
);
}
FilamentApiForgePlugin::make()
->apiKeys()
->docs(false) // hide docs, access control, and settings pages
->dashboard(false) // hide the dashboard
use YusufGenc34\FilamentApiForge\Attributes\ApiTag;
use YusufGenc34\FilamentApiForge\Attributes\ApiDescription;
use YusufGenc34\FilamentApiForge\Attributes\ApiOperations;
use YusufGenc34\FilamentApiForge\Attributes\ApiIgnore;
#[ApiTag('Posts')]
#[ApiDescription('Manage blog posts and articles.')]
#[ApiOperations(
index: 'List all posts with filtering and sorting',
store: ['summary' => 'Create a post', 'description' => 'Requires **write** scope.'],
destroy: ['summary' => 'Delete a post', 'description' => 'Requires **delete** scope.'],
)]
class PostResource extends Resource implements HasApi { ... }