承接 tomatophp/filament-docs 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

tomatophp/filament-docs

Composer 安装命令:

composer require tomatophp/filament-docs

包简介

Manage your documents and contracts all in one place with template builder

README 文档

README

Screenshot

Filament Documents Editor

Dependabot Updates PHP Code Styling Tests Latest Stable Version License Downloads

Manage your documents and contracts all in one place with template builder

Features

  • Generate Documents From Template
  • Build Template using Tiptop Editor
  • Add Custom Vars By Facade
  • Generate Documents Action
  • Documents Filter By Template
  • Print Document or Export as PDF
  • Documents Relation Manager
  • Custom Print Header & Footer
  • Custom Print CSS

Screenshots

Documents Create Document Documents Filters Print Document Templates Create Template Edit Template Edit Template Vars Edit Template Icons Document Action Document Relation Manager Generate Document Generate Document Notification

Installation

composer require tomatophp/filament-docs

after install your package please run this command

php artisan filament-docs:install

if you are not using this package as a plugin please register the plugin on /app/Providers/Filament/AdminPanelProvider.php

->plugin(
    \TomatoPHP\FilamentDocs\FilamentDocsPlugin::make()
)

Using

you can add the action to any table like this

use TomatoPHP\FilamentDocs\Filament\Actions\DocumentAction;

DocumentAction::make()
    ->vars(fn($record) => [
        DocsVar::make('$ACCOUNT_NAME')
            ->value($record->name),
        DocsVar::make('$ACCOUNT_EMAIL')
            ->value($record->email),
        DocsVar::make('$ACCOUNT_PHONE')
            ->value($record->phone)
    ])

and then you can use $ACCOUNT_NAME in your template

if you like to add a Global Var you can use Facade class like this

use TomatoPHP\FilamentDocs\Facades\FilamentDocs;
use TomatoPHP\FilamentDocs\Services\Contracts\DocsVar;

public function boot()
{
    FilamentDocs::register([
        DocsVar::make('$POST_TITLE')
            ->label('Post Title')
            ->model(Post::class)
            ->column('title'),
        DocsVar::make('$POST_TYPE')
            ->label('Post Type')
            ->model(Post::class)
            ->column('type'),
        DocsVar::make('$SELECTED_TIME')
            ->label('SELECTED TIME')
            ->value(fn () => Carbon::now()->subDays(10)->translatedFormat('D-M-Y')),
    ]);
}

as you can see you can use data from selected table or from a static function

Add Fixed Header & Footer to Document Print

if you like to add a fixed header and footer to your document print you can use this method on your AppServiceProvider.php file

use TomatoPHP\FilamentDocs\Facades\FilamentDocs;

public function boot() {
    FilamentDocs::header('filament.header');
    FilamentDocs::footer('filament.footer');
} 

Custom CSS on Document Print

if you like to add a custom css to your document print you can use this method on your AppServiceProvider.php file

use TomatoPHP\FilamentDocs\Facades\FilamentDocs;

public function boot() {
    FilamentDocs::css('filament.css');
} 

Allow Tenants

to allow tenants just use this method

->plugin(
    \TomatoPHP\FilamentDocs\FilamentDocsPlugin::make()
        ->isScopedToTenant()
)

and add this migration

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('documents', function (Blueprint $table) {
            $table->foreignId('team_id')->nullable()->constrained('teams')->onDelete('cascade');
        });
        
        Schema::table('document_templates', function (Blueprint $table) {
            $table->foreignId('team_id')->nullable()->constrained('teams')->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('documents', function (Blueprint $table) {
            $table->dropForeign(['team_id']);
            $table->dropColumn('team_id');
        });
        
        Schema::table('document_templates', function (Blueprint $table) {
            $table->dropForeign(['team_id']);
            $table->dropColumn('team_id');
        });
    }
};

Publish Assets

you can publish config file by use this command

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

you can publish views file by use this command

php artisan vendor:publish --tag="filament-docs-views"

you can publish languages file by use this command

php artisan vendor:publish --tag="filament-docs-lang"

you can publish migrations file by use this command

php artisan vendor:publish --tag="filament-docs-migrations"

Other Filament Packages

Checkout our Awesome TomatoPHP

tomatophp/filament-docs 适用场景与选型建议

tomatophp/filament-docs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.7k 次下载、GitHub Stars 达 45, 最近一次更新时间为 2024 年 10 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「template」 「document」 「laravel」 「contract」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 tomatophp/filament-docs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tomatophp/filament-docs 我们能提供哪些服务?
定制开发 / 二次开发

基于 tomatophp/filament-docs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2.7k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 45
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 45
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-14