{"id":22189907,"url":"https://github.com/saade/filament-extra","last_synced_at":"2025-07-26T22:30:37.825Z","repository":{"id":201227106,"uuid":"707260402","full_name":"saade/filament-extra","owner":"saade","description":"A set of reusable Filament helpers, columns, fields, actions and more!","archived":false,"fork":false,"pushed_at":"2024-07-08T03:49:24.000Z","size":53,"stargazers_count":19,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"3.x","last_synced_at":"2024-11-26T19:51:48.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/saade.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"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},"funding":{"github":"saade"}},"created_at":"2023-10-19T14:34:59.000Z","updated_at":"2024-10-21T06:58:10.000Z","dependencies_parsed_at":"2024-01-01T04:48:11.716Z","dependency_job_id":"c7ae8899-d5e3-4612-bd64-40526ee5554e","html_url":"https://github.com/saade/filament-extra","commit_stats":null,"previous_names":["saade/filament-extra"],"tags_count":4,"template":false,"template_full_name":"filamentphp/plugin-skeleton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saade%2Ffilament-extra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saade%2Ffilament-extra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saade%2Ffilament-extra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saade%2Ffilament-extra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saade","download_url":"https://codeload.github.com/saade/filament-extra/tar.gz/refs/heads/3.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227721459,"owners_count":17809766,"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","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":[],"created_at":"2024-12-02T11:40:04.289Z","updated_at":"2024-12-02T11:40:05.306Z","avatar_url":"https://github.com/saade.png","language":"PHP","funding_links":["https://github.com/sponsors/saade"],"categories":[],"sub_categories":[],"readme":"# Filament Extra\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/saade/filament-extra.svg?style=flat-square)](https://packagist.org/packages/saade/filament-extra)\n[![Total Downloads](https://img.shields.io/packagist/dt/saade/filament-extra.svg?style=flat-square)](https://packagist.org/packages/saade/filament-extra)\n\nA set of reusable Filament helpers, columns, fields, actions and more!\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require saade/filament-extra\n```\n- [Filament Extra](#filament-extra)\n  - [Installation](#installation)\n  - [Forms](#forms)\n    - [Relation Manager](#relation-manager)\n    - [ColorSelect](#colorselect)\n  - [Concerns](#concerns)\n    - [trait HasSoftDeletedRecords](#trait-hassoftdeletedrecords)\n    - [trait NavigationGroupAwareBreadcrumbs](#trait-navigationgroupawarebreadcrumbs)\n    - [trait HasParentResource](#trait-hasparentresource)\n  - [Support](#support)\n    - [class Color](#class-color)\n    - [function color](#function-color)\n    - [function html](#function-html)\n    - [function md](#function-md)\n    - [function blade](#function-blade)\n  - [Changelog](#changelog)\n  - [Contributing](#contributing)\n  - [Security Vulnerabilities](#security-vulnerabilities)\n  - [Credits](#credits)\n  - [License](#license)\n\n## Forms\n\n### Relation Manager\nThis field lets you render a [Relation Manager]() inside a form. It's useful if you need to render it inside a tab or a modal.\n\n```php\nuse Saade\\FilamentExtra\\Forms\\Components\\RelationManager;\nuse App\\Filament\\Resources\\YourResource\\RelationManagers\\YourRelationManager;\n\nRelationManager::make(YourRelationManager::class)\n    -\u003elazy(bool $lazy = true)\n```\n\n### ColorSelect\nThis field lets you pick a Filament color from your application.\n\n```php\nuse Saade\\FilamentExtra\\Forms\\Components\\ColorSelect;\n\nColorSelect::make('color')\n```\n\n## Concerns\n\n### trait HasSoftDeletedRecords\nTired of overriding the `getEloquentQuery` method in every resource? This trait will handle soft deletes for you.\n\n```php\nuse Filament\\Resources\\Resource;\n\nuse Saade\\FilamentExtra\\Concerns\\HasSoftDeletedRecords;\n\nclass YourResource extends Resource\n{\n    use HasSoftDeletedRecords;\n}\n```\n\n### trait NavigationGroupAwareBreadcrumbs\nThis trait will handle breadcrumbs for you. It's useful if you need to render breadcrumbs for a resource that belongs to a navigation group.\n\n```php\nuse Filament\\Resources\\Pages\\CreateRecord;\n\nuse Saade\\FilamentExtra\\Concerns\\NavigationGroupAwareBreadcrumbs;\n\nclass CreateYourRecord extends CreateRecord\n{\n    use NavigationGroupAwareBreadcrumbs;\n}\n```\n\n### trait HasParentResource\nThis trait will handle nested resources for you. [Read the blog post](https://laraveldaily.com/post/filament-nested-resources-courses-lessons) if you want to know more. This code was partially taken from [LaravelDaily/filament-nested-resources](https://github.com/LaravelDaily/filament-nested-resources) and contributed back to the community.\n\n1. Add the `$parentResource` property to your child resource.\n```php\nuse Filament\\Resources\\Resource;\n\nclass ChildResource extends Resource\n{\n    public static ?string $parentResource = ParentResource::class;\n}\n```\n\n2. Add the child resource pages to the parent resource.\n```php\nuse Filament\\Resources\\Resource;\n\nclass ParentResource extends Resource\n{\n    public static function getPages(): array\n    {\n        return [\n            'index' =\u003e Pages\\ManageParents::route('/'),\n            'edit' =\u003e Pages\\EditParent::route('/{record}/edit'),\n\n            // Please note that 'child' can be anything you want. It defaults to the resource slug.\n            // If you want to change it, you need to override the $pageNamePrefix property on the child resource pages.\n            'child.index' =\u003e ChildResource\\Pages\\ListChildren::route('/{parent}/children'),\n            'child.create' =\u003e ChildResource\\Pages\\CreateChild::route('{parent}/children/create'),\n            'child.edit' =\u003e ChildResource\\Pages\\EditChild::route('{parent}/children/{record}/edit'),\n        ];\n    }\n}\n```\n\n3. Add the trait to your child resource pages.\n```php\nuse Filament\\Resources\\Pages\\ListRecords;\n\nuse Saade\\FilamentExtra\\Concerns\\HasParentResource;\n\nclass ListChildren extends ListRecords\n{\n    use HasParentResource;\n\n    // (optional) Define custom relationship key (if it does not match the table name pattern).\n    protected ?string $relationshipKey = 'parent_id';\n\n    // (optional) Define custom child page name prefix for child pages (if it does not match the parent resource slug).\n    protected ?string $pageNamePrefix = 'child';\n}\n```\n\n## Support\n\n### class Color\nThis class helps you interact with Filament colors. It's useful if you need to convert a color to a hex value, pick a shade to `collect()` Filament colors.\n\n```php\nuse Saade\\FilamentExtra\\Support\\Color;\n\nColor::make(name: 'fuchia', shade: 200)\n  -\u003eshade(int $shade = 500)   // Set a shade\n  -\u003eget()                     // Returns the color as array of shades\n  -\u003etoHex()                   // Returns the color as hex value\n  -\u003etoRgb()                   // Returns the color as rgb value\n  -\u003ecollect()                 // Returns the color as a Laravel Collection\n```\n\n### function color\nThis function is a shortcut to the `Color` class.\n\n```php\nuse function Saade\\FilamentExtra\\Support\\color;\n\ncolor(name: 'fuchia', shade: 200)\n  -\u003eshade(int $shade = 500)   // Set a shade\n  -\u003eget()                     // Returns the color as array of shades\n  -\u003etoHex()                   // Returns the color as hex value\n  -\u003etoRgb()                   // Returns the color as rgb value\n  -\u003ecollect()                 // Returns the color as a Laravel Collection\n```\n\n### function html\nUse this function as a shortcut to the `Illuminate\\Support\\HtmlString` class.\n\n```php\nuse Filament\\Forms;\n\nuse function Saade\\FilamentExtra\\Support\\html;\n\nFilament\\Forms\\Components\\SomeField::make()\n  -\u003elabel(\n    html('\u003cspan class=\"text-red-500\"\u003e*\u003c/span\u003e Label')\n  )\n```\n\n### function md\nUse this function as a shortcut to the `Illuminate\\Support\\HtmlString` class to convert markdown to HtmlString.\n\n```php\nuse Filament\\Forms;\n\nuse function Saade\\FilamentExtra\\Support\\md;\n\nFilament\\Forms\\Components\\SomeField::make()\n  -\u003elabel(\n    md('### Label')\n  )\n```\n\n### function blade\nUse this function to render blade templates.\n\n```php\nuse Filament\\Forms;\n\nuse function Saade\\FilamentExtra\\Support\\blade;\n\nFilament\\Forms\\Components\\SomeField::make()\n  -\u003elabel(\n    blade('\u003cx-heroicon::some-icon class=\"w-5 h-5\" /\u003e Label', ['some' =\u003e 'data'])\n  )\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Saade](https://github.com/saade)\n- [LaravelDaily](https://github.com/LaravelDaily/filament-nested-resources) For the nested resource implementation.\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaade%2Ffilament-extra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaade%2Ffilament-extra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaade%2Ffilament-extra/lists"}