Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Grumphp Bom Task

Grumphp Bom Task Laravel Package

pluswerk/grumphp-bom-task

GrumPHP task that enforces files to be saved without a UTF-8 BOM. Install via Composer and enable the PLUS\GrumPHPBomTask\ExtensionLoader, then run the plus_bom_fixer task on selected file types (php, css, json, yml, etc.).

View on GitHub
Deep Wiki
Context7

🚩READONLY: Force files to have no BOM via GrumPHP Edit Add topics

Frequently asked questions about Grumphp Bom Task
How do I install this package for Laravel projects?
Run `composer require --dev pluswerk/grumphp-bom-task` in your Laravel project. Ensure GrumPHP is installed (`composer require --dev grumphp/grumphp`) as this package extends it. Configure `grumphp.yml` to enable the `plus_bom_fixer` task with your target file types.
Which Laravel file types should I scan for BOMs?
Prioritize `config/*.php`, `package.json`, `composer.json`, Blade templates (`.blade.php`), migrations, and SQL files. JSON/YAML configs (e.g., `app/Config/`) are critical—BOMs break parsing. Exclude `vendor/` and `storage/logs/` to avoid false positives.
Does this work with Laravel’s default PHP 8.x setup?
Yes. The package supports PHP 7.3+ and GrumPHP v0.16+/v1.x, which aligns with Laravel’s PHP 8.x minimum. No Laravel-specific dependencies exist—it operates at the file level, avoiding framework conflicts.
Can I integrate this into Laravel’s GitHub Actions CI?
Absolutely. Add a step to run GrumPHP (e.g., `./vendor/bin/grumphp run`) in your workflow. Place it before tests or deployment to enforce BOM-free files. Example: `uses: actions/checkout@v3` followed by the GrumPHP command.
What if my team uses Windows-generated files with BOMs?
Configure `ignore` patterns in `grumphp.yml` to exclude known exceptions (e.g., `legacy/`, `vendor/`). For manual overrides, document a workflow to approve BOM-containing files or use the `aus_bom_fixer` task’s exclusion rules.
Is this package safe for monorepos with mixed languages?
Yes. The task targets file extensions (e.g., `php`, `json`, `yml`) via `triggered_by`. Exclude non-text files (e.g., binaries) and configure GrumPHP to run only on relevant directories. Test with your monorepo’s structure to avoid over-scanning.
How does this differ from running a custom script to strip BOMs?
This package integrates natively with GrumPHP, offering pre-commit/pre-push enforcement with clear failure messages. Custom scripts lack GrumPHP’s extensibility (e.g., parallel runs, CI hooks) and may miss edge cases like partial BOMs in multi-byte UTF-8 files.
Will this break existing Laravel deployments?
No. The package only modifies files during development/pre-commit stages. It won’t alter runtime behavior. Test in staging by running `grumphp run` locally before deployment to catch BOM issues early.
How do I handle false positives in Laravel’s Blade templates?
Add Blade files (`.blade.php`) to `triggered_by` in `grumphp.yml` but exclude directories like `resources/views/vendor/`. For templates with legitimate BOMs (rare), use the `ignore` option or document them in a `README` for the team.
What’s the performance impact of running this in CI?
Minimal. The task scans files only during GrumPHP execution (not runtime) and supports parallelization. In CI, run it alongside other tasks (e.g., `phpunit`) to avoid bottlenecks. For large repos, limit `triggered_by` to critical file types.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky