tomatophp/filament-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tomatophp/filament-api

最新稳定版本:v1.0.2

Composer 安装命令:

composer require tomatophp/filament-api

包简介

Generate APIs from your filament resource using single line of code

README 文档

README

Screenshot

Resource API Generator

Latest Stable Version License Downloads

Generate APIs from your filament resource using single line of code

Installation

make sure that you have SQLite3 Driver installed on your PHP config, because this package required it for caching.

composer require tomatophp/filament-api

if you want to use API Resource to list your generated APIs you can register the plugin on /app/Providers/Filament/AdminPanelProvider.php

->plugin(\TomatoPHP\FilamentApi\FilamentAPIPlugin::make())

Screenshots

APIs Resource

Usage

you can generate API by add this trait to your resource pages

use TomatoPHP\FilamentApi\Traits\InteractWithAPI;
use \Filament\Resources\Pages\ListRecords;

class ListPosts extends ListRecords
{
    use InteractWithAPI;
}

and that's it you can now access your API by /api/{slug}

we provide 5 methods:

  • GET /api/{slug} to list all records support searching by use search=
  • GET /api/{slug}/{id} to get single record
  • POST /api/{slug} to create new record
  • PUT /api/{slug}/{id} to update record
  • DELETE /api/{slug}/{id} to delete record

Custom your API

you can customize your api by override this methods

// Use to return API JSON Resource on Index/Show/Store/Update
public static function getFilamentAPIResource(): ?string
{
    return null;
}

// Use To Custom Your Route Middleware
public static function getFilamentAPIMiddleware(): array
{
    return config('filament-api.default_middleware');
}

// Use To Change the Endpoint Slug
public static function getFilamentAPISlug(): ?string
{
    return null;
}

Publish Assets

you can publish config file by use this command

php artisan vendor:publish --tag="filament-api-config"

Other Filament Packages

checkout our Awesome TomatoPHP

统计信息

  • 总下载量: 7.2k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 49
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 49
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固