{"id":22238780,"url":"https://github.com/tomatophp/filament-types","last_synced_at":"2025-09-20T10:14:31.436Z","repository":{"id":232696006,"uuid":"784970989","full_name":"tomatophp/filament-types","owner":"tomatophp","description":"Manage any type on your app in Database with easy to use Resource for FilamentPHP","archived":false,"fork":false,"pushed_at":"2025-08-26T02:46:07.000Z","size":4157,"stargazers_count":46,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-26T04:03:53.567Z","etag":null,"topics":["enum","filament","filamentphp","laravel","manage-types","type-application","type-service","types"],"latest_commit_sha":null,"homepage":"https://tomatophp.com/en/open-source/filament-types","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomatophp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["3x1io"]}},"created_at":"2024-04-10T23:38:16.000Z","updated_at":"2025-08-26T02:46:10.000Z","dependencies_parsed_at":"2024-06-03T20:22:43.102Z","dependency_job_id":"5ad5a2df-08b7-4154-b588-00b29428307a","html_url":"https://github.com/tomatophp/filament-types","commit_stats":null,"previous_names":["tomatophp/filament-types"],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/tomatophp/filament-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomatophp","download_url":"https://codeload.github.com/tomatophp/filament-types/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276079788,"owners_count":25581695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["enum","filament","filamentphp","laravel","manage-types","type-application","type-service","types"],"created_at":"2024-12-03T03:17:15.953Z","updated_at":"2025-09-20T10:14:31.422Z","avatar_url":"https://github.com/tomatophp.png","language":"PHP","funding_links":["https://github.com/sponsors/3x1io"],"categories":["Plugins List"],"sub_categories":["Filament Types"],"readme":"![Screenshot](https://raw.githubusercontent.com/tomatophp/filament-types/master/arts/fadymondy-tomato-types.jpg)\n\n# Filament Types Manager\n\n[![Dependabot Updates](https://github.com/tomatophp/filament-types/actions/workflows/dependabot/dependabot-updates/badge.svg)](https://github.com/tomatophp/filament-types/actions/workflows/dependabot/dependabot-updates)\n[![PHP Code Styling](https://github.com/tomatophp/filament-types/actions/workflows/fix-php-code-styling.yml/badge.svg)](https://github.com/tomatophp/filament-types/actions/workflows/fix-php-code-styling.yml)\n[![Tests](https://github.com/tomatophp/filament-types/actions/workflows/tests.yml/badge.svg)](https://github.com/tomatophp/filament-types/actions/workflows/tests.yml)\n[![Latest Stable Version](https://poser.pugx.org/tomatophp/filament-types/version.svg)](https://packagist.org/packages/tomatophp/filament-types)\n[![License](https://poser.pugx.org/tomatophp/filament-types/license.svg)](https://packagist.org/packages/tomatophp/filament-types)\n[![Downloads](https://poser.pugx.org/tomatophp/filament-types/d/total.svg)](https://packagist.org/packages/tomatophp/filament-types)\n\nManage any type on your app in Database with easy to use Resource for FilamentPHP\n\n## Screenshots\n\n![Types](https://raw.githubusercontent.com/tomatophp/filament-types/master/arts/types.png)\n![Filters](https://raw.githubusercontent.com/tomatophp/filament-types/master/arts/filters.png)\n![Type Col](https://raw.githubusercontent.com/tomatophp/filament-types/master/arts/type-col.png)\n![Form](https://raw.githubusercontent.com/tomatophp/filament-types/master/arts/form.png)\n\n## Installation\n\n```bash\ncomposer require tomatophp/filament-types\n```\n\nafter install your package please run this command\n\n```bash\nphp artisan filament-types:install\n```\n\nfinally register the plugin on `/app/Providers/Filament/AdminPanelProvider.php`\n\n```php\nuse TomatoPHP\\FilamentTypes\\Services\\Contracts\\Type;\nuse TomatoPHP\\FilamentTypes\\Services\\Contracts\\TypeFor;\nuse TomatoPHP\\FilamentTypes\\Services\\Contracts\\TypeOf;\n\n-\u003eplugin(\\TomatoPHP\\FilamentTypes\\FilamentTypesPlugin::make())\n    -\u003etypes([\n        TypeFor::make('posts')\n            -\u003elabel('Posts')\n            -\u003etypes([\n                TypeOf::make('categories')\n                    -\u003elabel('Categories')\n                    -\u003eregister([\n                        Type::make('news')\n                            -\u003ename('News')\n                            -\u003eicon('heroicon-o-newspaper')\n                            -\u003ecolor('#fefefe')\n                    ])\n            ])\n    ])\n```\n\n## Register Type using provider\n\nyou can register a type from your provider using our Facade\n\n```php\nuse TomatoPHP\\FilamentTypes\\Facades\\FilamentTypes;\nuse TomatoPHP\\FilamentTypes\\Services\\Contracts\\Type;\nuse TomatoPHP\\FilamentTypes\\Services\\Contracts\\TypeFor;\nuse TomatoPHP\\FilamentTypes\\Services\\Contracts\\TypeOf;\n\nFilamentTypes::register([\n    TypeFor::make('products')\n        -\u003elabel('Product')\n        -\u003etypes([\n            TypeOf::make('sizes')\n                -\u003elabel('Sizes')\n                -\u003eregister([\n                    Type::make('xl')\n                        -\u003ename('XL')\n                        -\u003eicon('heroicon-o-adjustments-horizontal')\n                        -\u003ecolor('warning'),\n                    Type::make('sm')\n                        -\u003ename('SM')\n                        -\u003eicon('heroicon-o-adjustments-horizontal')\n                        -\u003ecolor('warning')\n                ])\n        ]),\n]);\n```\n\n## Config Locales\n\nYou can change the locals within the `filament-types` config.\n\n- Publish the config file/\n- Modify the `locals` array to include the two character language code that applys to the language you wish to offer. EG:\n\n```\n'locals' = ['en'],\n```\n\n## Use Type Helper\n\nyou can find any type with the helper method to use it anywhere\n\n```php\ntype_of(\n    key: 'pending',\n    for: 'notes',\n    type: 'groups'\n);\n```\n\nit will return type model for you.\n\n## Use Type Column\n\nyou can use type column in your table like this\n\n```php\nuse TomatoPHP\\FilamentTypes\\Components\\TypeColumn;\n\nTypeColumn::make('type')\n    -\u003efor('users')\n    -\u003etype('status')\n    -\u003eallowDescription()\n    -\u003esearchable(),\n```\n\n## Auto Caching\n\non your `.env` add this\n\n```.env\nCACHE_STORE=array\nMODEL_CACHE_STORE=array\n```\n\nsupported cache stores are\n\n```php\n+ Redis\n+ MemCached\n+ APC\n+ Array\n```\n\n## Use Type Base Page\n\nyou can create a page for selected type by just extand base type page\n\n```php\nuse TomatoPHP\\FilamentTypes\\Pages\\BaseTypePage;\n\nuse TomatoPHP\\FilamentTypes\\Services\\Contracts\\Type;\n\nclass NotesGroups extends BaseTypePage\n{\n     public function getTitle(): string\n    {\n        return \"Notes Groups\";\n    }\n\n    public function getType(): string\n    {\n        return \"groups\";\n    }\n\n    public function getFor(): string\n    {\n        return \"notes\";\n    }\n\n    public function getBackUrl()\n    {\n        return ManageNotes::getUrl(); // TODO: Change the autogenerated stub\n    }\n\n    public function getTypes(): array\n    {\n        return [\n            Type::make('todo')\n                -\u003ename(\"TODO\")\n                -\u003ecolor('#1461e3')\n                -\u003eicon('heroicon-o-list-bullet'),\n            Type::make('ideas')\n                -\u003ename(\"Ideas\")\n                -\u003ecolor('#13e0da')\n                -\u003eicon('heroicon-o-sparkles'),\n            Type::make('saved')\n                -\u003ename(\"Saved\")\n                -\u003ecolor('#29a82e')\n                -\u003eicon('heroicon-o-arrow-down-on-square'),\n        ];\n    }\n}\n```\n\nit will be not appear on the navigation menu by default but you can change that by just use this method\n\n```php\npublic static function shouldRegisterNavigation(): bool\n{\n    return true;\n}\n```\n\n## Use Type Component\n\nif you like to use a type as a package we create a blade component for you to make it easy to use anywhere on your app like this\n\n```html\n\u003cx-tomato-type :type=\"$type\" label=\"Group\" /\u003e\n```\n\n## User Types Resource Hooks\n\nwe have add a lot of hooks to make it easy to attach actions, columns, filters, etc\n\n### Table Columns\n\n```php\nuse TomatoPHP\\FilamentTypes\\Filament\\Resources\\TypeResource\\Table\\TypeTable;\n\npublic function boot()\n{\n    TypeTable::register([\n        \\Filament\\Tables\\Columns\\TextColumn::make('something')\n    ]);\n}\n```\n\n### Table Actions\n\n```php\nuse TomatoPHP\\FilamentTypes\\Filament\\Resources\\TypeResource\\Table\\TypeActions;\n\npublic function boot()\n{\n    TypeActions::register([\n        \\Filament\\Tables\\Actions\\ReplicateAction::make()\n    ]);\n}\n```\n\n### Table Filters\n\n```php\nuse TomatoPHP\\FilamentTypes\\Filament\\Resources\\TypeResource\\Table\\TypeFilters;\n\npublic function boot()\n{\n    TypeFilters::register([\n        \\Filament\\Tables\\Filters\\SelectFilter::make('something')\n    ]);\n}\n```\n\n### Table Bulk Actions\n\n```php\nuse TomatoPHP\\FilamentTypes\\Filament\\Resources\\TypeResource\\Table\\TypeBulkActions;\n\npublic function boot()\n{\n    TypeBulkActions::register([\n        \\Filament\\Tables\\BulkActions\\DeleteAction::make()\n    ]);\n}\n```\n\n### From Components\n\n```php\nuse TomatoPHP\\FilamentTypes\\Filament\\Resources\\TypeResource\\Form\\TypeForm;\n\npublic function boot()\n{\n    TypeForm::register([\n        \\Filament\\Forms\\Components\\TextInput::make('something')\n    ]);\n}\n```\n\n### Page Actions\n\n```php\nuse TomatoPHP\\FilamentTypes\\Filament\\Resources\\TypeResource\\Actions\\ManagePageActions;\n\npublic function boot()\n{\n    ManagePageActions::register([\n        Filament\\Actions\\Action::make('action')\n    ]);\n\n}\n```\n\n## Publish Assets\n\nyou can publish config file by use this command\n\n```bash\nphp artisan vendor:publish --tag=\"filament-types-config\"\n```\n\nyou can publish views file by use this command\n\n```bash\nphp artisan vendor:publish --tag=\"filament-types-views\"\n```\n\nyou can publish languages file by use this command\n\n```bash\nphp artisan vendor:publish --tag=\"filament-types-lang\"\n```\n\nyou can publish migrations file by use this command\n\n```bash\nphp artisan vendor:publish --tag=\"filament-types-migrations\"\n```\n\n## Testing\n\nif you like to run `PEST` testing just use this command\n\n```bash\ncomposer test\n```\n\n## Code Style\n\nif you like to fix the code style just use this command\n\n```bash\ncomposer format\n```\n\n## PHPStan\n\nif you like to check the code by `PHPStan` just use this command\n\n```bash\ncomposer analyse\n```\n\n## Other Filament Packages\n\nCheckout our [Awesome TomatoPHP](https://github.com/tomatophp/awesome)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomatophp%2Ffilament-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomatophp%2Ffilament-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomatophp%2Ffilament-types/lists"}