edrisaturay / filament-api-docs-builder
This package will give you the best API docs building experience.
Installs: 0
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 3
Open Issues: 0
pkg:composer/edrisaturay/filament-api-docs-builder
Requires
- php: ^8.2
- filament/filament: ^4.0|^5.0
- spatie/laravel-package-tools: ^1.15|^2.0
- tempest/highlight: ^2.10
- zpmlabs/filament-icon-picker: ^1.0.0
Requires (Dev)
- nunomaduro/collision: ^7.9|^8.0
- orchestra/testbench: ^8.0|^10.0
- pestphp/pest: ^2.1|^3.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
README
Filament Api Docs Builder
This package allows you to build a good looking and functional api documentation. Including exporting and importing actions with postman standard.
Requirements
- PHP 8.2+
- Filament v4 or v5 (
^4.0|^5.0)- For Filament v4: Laravel 10.x or 11.x, Livewire v3
- For Filament v5: Laravel 11.28+, Livewire v4
Installation
You can install the package via composer repositories:
composer require edrisaturay/filament-api-docs-builder
You can install the package with:
php artisan filament-api-docs-builder:install
Also you need to add a source to your custom theme:
@source '<path-to-vendor>/vendor/edrisaturay/filament-api-docs-builder/resources/views/filament/**/*';
Otherwise you can publish and run the migrations with:
php artisan vendor:publish --tag="filament-api-docs-builder-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="filament-api-docs-builder-config"
Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-api-docs-builder-views"
Usage
You can use this package by registering the plugin inside you filament service provider.
->plugin(EdrisaTuray\FilamentApiDocsBuilder\FilamentApiDocsBuilderPlugin::make())
Otherwise you can make your own resource and ApiDocsFormBuilder for form generation.
use EdrisaTuray\FilamentApiDocsBuilder\Filament\Forms\ApiDocsFormBuilder; public static function getModel(): string { return config('filament-api-docs-builder.model'); } public static function form(Form $form): Form { return $form->schema(ApiDocsFormBuilder::make()); }
And ApiDocsInfolistBuilder for infolist generation.
use EdrisaTuray\FilamentApiDocsBuilder\Filament\Infolists\ApiDocsInfolistBuilder; public static function getResource(): string { return config('filament-api-docs-builder.resource'); } public function infolist(Infolist $infolist): Infolist { $record = $this->getRecord(); $this->heading = '[v' . $record->version . '] ' . $record->title; $this->subheading = $record->description; return $infolist->schema(ApiDocsInfolistBuilder::make($record)); }
There are also two actions for export and import docs with postman json standard.
use EdrisaTuray\FilamentApiDocsBuilder\Filament\Actions\CollectionDownloaderAction; use EdrisaTuray\FilamentApiDocsBuilder\Filament\Actions\CollectionImporterAction; protected function getHeaderActions(): array { return [ CollectionDownloaderAction::make('downloader'), CollectionImporterAction::make('importer'), ]; }
This package includes various different code builders but you can add your own in config code_builders array.
You can also predefine your enpoint parameter in config predefined_params array. [Check config for more details]
If you are using multi tenancy you need to set your tenant model class in config with method getTenant.
If you want to use infolist publicly, just make a public filament page and pass in infolist.
Screenshots
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Original Author: ZPMLabs - Original
zpmlabs/filament-api-docs-builderpackage - Maintainer: Edrisa Turay
- All Contributors
License
MIT License. Please see License File for more information.
This package is a fork and rebrand of the original zpmlabs/filament-api-docs-builder package. The original package was proprietary licensed. This fork is released under the MIT License with proper attribution to the original author.
