{"id":28126158,"url":"https://github.com/t-labs-co/formatter","last_synced_at":"2026-03-07T07:32:30.337Z","repository":{"id":283606114,"uuid":"941780512","full_name":"T-Labs-Co/formatter","owner":"T-Labs-Co","description":"This package helps you format your PHP strings. You can use it for one string or many, and it's as simple as using Laravel validation.","archived":false,"fork":false,"pushed_at":"2025-07-28T16:48:41.000Z","size":54,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-28T18:41:16.261Z","etag":null,"topics":["formatter","helpers","laravel","package","php","string-formatter","t-labs-co"],"latest_commit_sha":null,"homepage":"https://github.com/T-Labs-Co/formatter","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/T-Labs-Co.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"ty-huynh"}},"created_at":"2025-03-03T03:19:42.000Z","updated_at":"2025-07-28T16:48:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"edaad384-0f12-4245-97a6-25ba12bc11ae","html_url":"https://github.com/T-Labs-Co/formatter","commit_stats":null,"previous_names":["t-labs-co/formatter"],"tags_count":3,"template":false,"template_full_name":"spatie/package-skeleton-laravel","purl":"pkg:github/T-Labs-Co/formatter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Labs-Co%2Fformatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Labs-Co%2Fformatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Labs-Co%2Fformatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Labs-Co%2Fformatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/T-Labs-Co","download_url":"https://codeload.github.com/T-Labs-Co/formatter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-Labs-Co%2Fformatter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["formatter","helpers","laravel","package","php","string-formatter","t-labs-co"],"created_at":"2025-05-14T10:23:38.207Z","updated_at":"2026-03-07T07:32:30.321Z","avatar_url":"https://github.com/T-Labs-Co.png","language":"PHP","funding_links":["https://github.com/sponsors/ty-huynh"],"categories":[],"sub_categories":[],"readme":"# The PHP Formatter package\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/t-labs-co/formatter.svg?style=flat-square)](https://packagist.org/packages/t-labs-co/formatter)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/t-labs-co/formatter/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/t-labs-co/formatter/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/t-labs-co/formatter/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/t-labs-co/formatter/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/t-labs-co/formatter.svg?style=flat-square)](https://packagist.org/packages/t-labs-co/formatter)\n\nThis package helps you format your PHP strings. You can use it for one string or many, and it's as simple as using Laravel validation.\n\n## Work with us\n\nWe're PHP and Laravel whizzes, and we'd love to work with you! We can:\n\n- Design the perfect fit solution for your app.\n- Make your code cleaner and faster.\n- Refactoring and Optimize performance.\n- Ensure Laravel best practices are followed.\n- Provide expert Laravel support.\n- Review code and Quality Assurance.\n- Offer team and project leadership.\n- Delivery Manager\n\n## Features\n\n- Simple and intuitive syntax for defining formatting rules.\n- Support for multiple built-in formatting rules (e.g., trim, replace, limit, date_format).\n- Ability to create custom formatting rules.\n- Integration with Laravel models and validation.\n- Comprehensive unit tests for ensuring reliability.\n\n## PHP and Laravel Version Support\n\nThis package supports the following versions of PHP:\n\n- PHP: `^8.2`\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require t-labs-co/formatter\n```\n\n## Usage\n\n```php\nuse TLabsCo\\Formatter\\Formatter;\n\n$formatterRules = [\n    'title' =\u003e 'trim|replace:Local Composer Dependencies,[Local Composer Dependencies]|replace:[Local Composer Dependencies],[Composer Dependencies]|limit:150',\n    'publish_date' =\u003e 'date_format:Y-m-d',\n];\n\n$data = [\n    'title' =\u003e '  How to resolve missing Local Composer Dependencies on CentOS 8?  ',\n    'publish_date' =\u003e '2024/05/02 13:00'\n];\n\n$formatted = Formatter::make($data, $formatterRules)-\u003eformat()-\u003eformatted();\n\n/*\nOutput:\n$formatted = [\n    'title' =\u003e 'How to resolve missing [Composer Dependencies] on CentOS 8?',\n    'publish_date' =\u003e '2024-05-02'\n];\n*/\n```\n\nUse custom format rule\n\n```php\n\nuse TLabsCo\\Formatter\\Rules\\FormatterRule;\n\nclass Max100FormatRule extends FormatterRule\n{\n    public function format($attribute, $value)\n    {\n        if (strlen($value) \u003e 100) {\n            return substr($value, 0, 100);\n        }\n\n        return $value;\n    }\n}\n// Using with custom rule\nuse TLabsCo\\Formatter\\Formatter;\n\n$formatterRules = [\n    'title' =\u003e 'trim|replace:Local Composer Dependencies,[Local Composer Dependencies]|replace:[Local Composer Dependencies],[Composer Dependencies]|limit:150',\n    'publish_date' =\u003e 'date_format:Y-m-d',\n    'short_description' =\u003e ['trim', new Max100FormatRule()],\n];\n\n$data = [\n    'title' =\u003e '  How to resolve missing Local Composer Dependencies on CentOS 8?  ',\n    'publish_date' =\u003e '2024/05/02 13:00',\n    'short_description' =\u003e 'Very long description Very long description Very long description Very long description Very long description Very long description Very long description Very long description Very long description Very long description Very long description Very long description Very long description Very long description '\n];\n\n$formatted = Formatter::make($data, $formatterRules)-\u003eformat()-\u003eformatted();\n\n/*\nOutput:\n$formatted = [\n    'title' =\u003e 'How to resolve missing [Composer Dependencies] on CentOS 8?',\n    'publish_date' =\u003e '2024-05-02',\n    'short_description' =\u003e 'Very long description Very long description Very long description Very long description Very long de'\n];\n*/\n\n```\n\n## Testing\n\n```bash\ncomposer test\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](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- [T.](https://github.com/ty-huynh)\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%2Ft-labs-co%2Fformatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft-labs-co%2Fformatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft-labs-co%2Fformatter/lists"}