PHPackages                             tomatophp/filament-docs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. tomatophp/filament-docs

ActiveLibrary[Templating &amp; Views](/categories/templating)

tomatophp/filament-docs
=======================

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

2.0.0(1y ago)452.7k↓85.7%5[5 issues](https://github.com/tomatophp/filament-docs/issues)[4 PRs](https://github.com/tomatophp/filament-docs/pulls)MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Oct 14Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/tomatophp/filament-docs)[ Packagist](https://packagist.org/packages/tomatophp/filament-docs)[ GitHub Sponsors](https://github.com/3x1io)[ RSS](/packages/tomatophp-filament-docs/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (14)Versions (10)Used By (0)

[![Screenshot](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/3x1io-tomato-docs.jpg)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/3x1io-tomato-docs.jpg)

Filament Documents Editor
=========================

[](#filament-documents-editor)

[![Dependabot Updates](https://github.com/tomatophp/filament-docs/actions/workflows/dependabot/dependabot-updates/badge.svg)](https://github.com/tomatophp/filament-docs/actions/workflows/dependabot/dependabot-updates)[![PHP Code Styling](https://github.com/tomatophp/filament-docs/actions/workflows/fix-php-code-styling.yml/badge.svg)](https://github.com/tomatophp/filament-docs/actions/workflows/fix-php-code-styling.yml)[![Tests](https://github.com/tomatophp/filament-docs/actions/workflows/tests.yml/badge.svg)](https://github.com/tomatophp/filament-docs/actions/workflows/tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/0f083bafcd86936b2dc80440fdc451a05ccae39019291e2c71c538fd83721a1e/68747470733a2f2f706f7365722e707567782e6f72672f746f6d61746f7068702f66696c616d656e742d646f63732f76657273696f6e2e737667)](https://packagist.org/packages/tomatophp/filament-docs)[![License](https://camo.githubusercontent.com/0789618dc162e88f23c8fb85d7f505b0b8de28cfff846c74580661296dd01446/68747470733a2f2f706f7365722e707567782e6f72672f746f6d61746f7068702f66696c616d656e742d646f63732f6c6963656e73652e737667)](https://packagist.org/packages/tomatophp/filament-docs)[![Downloads](https://camo.githubusercontent.com/8322a97058cb2c61a6777557373ff3c6e87cdc0dd9c9e6b5256263da336400f7/68747470733a2f2f706f7365722e707567782e6f72672f746f6d61746f7068702f66696c616d656e742d646f63732f642f746f74616c2e737667)](https://packagist.org/packages/tomatophp/filament-docs)

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

Features
--------

[](#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 &amp; Footer
- Custom Print CSS

Screenshots
-----------

[](#screenshots)

[![Documents](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/documents.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/documents.png)[![Create Document](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/create-document.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/create-document.png)[![Documents Filters](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/documents-filters.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/documents-filters.png)[![Print Document](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/print-document.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/print-document.png)[![Templates](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/templates.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/templates.png)[![Create Template](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/create-template.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/create-template.png)[![Edit Template](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/edit-template.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/edit-template.png)[![Edit Template Vars](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/edit-template-vars.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/edit-template-vars.png)[![Edit Template Icons](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/edit-template-icon.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/edit-template-icon.png)[![Document Action](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/document-action.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/document-action.png)[![Document Relation Manager](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/document-relation.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/document-relation.png)[![Generate Document](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/generate-document.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/generate-document.png)[![Generate Document Notification](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/generate-notification.png)](https://raw.githubusercontent.com/tomatophp/filament-docs/master/arts/generate-notification.png)

Installation
------------

[](#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
-----

[](#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 &amp; Footer to Document Print
-----------------------------------------------

[](#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
----------------------------

[](#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
-------------

[](#allow-tenants)

to allow tenants just use this method

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

and add this migration

```
