okipa/laravel-html-helper
A Laravel package of HTML helper utilities that simplify building markup in your views and PHP code. Generate common HTML elements and attributes with clean, expressive helpers, reducing repetitive template code while keeping output readable, consistent, and easy to maintain across your Laravel appl...
This is a major-version release, so treat the upgrade as a small migration rather than a drop-in Composer update. Start by reading the linked upgrade guide (/docs/upgrade-guides/from-v1-to-v2.md) and checking the package’s composer.json constraints against your application’s PHP version. v2 adds PHP 8 support, but you should confirm whether your target PHP version is now the minimum or simply newly supported.
Minimal upgrade steps:
composer require vendor/package:^2.0
grep -R "oldHelperName\|OldHelperClass" app config routes tests resources
vendor/bin/phpcs --standard=PSR12 app
First practical use case: if your application calls the package’s helpers directly in controllers, Blade templates, or service providers, update those call sites first. Helpers are often used implicitly, so search broadly rather than only in app/. Once the renamed helpers are resolved, use the package normally in a small feature or test path to verify runtime behavior.
Wrap helper calls in application-level adapters during migration. If the package’s helpers are used in many places, introduce small local wrapper functions or service methods with your application’s stable names. Map old helper names to new v2 names inside the wrapper, then migrate call sites incrementally. This is especially useful when helpers are used in Blade templates, where global function renames can be harder to trace.
// app/Support/package_helpers.php
if (! function_exists('app_package_helper')) {
function app_package_helper(...$args)
{
return newPackageHelperName(...$args); // v2 name
}
}
Then replace direct calls over time:
// Before
$value = oldHelperName($input);
// After
$value = app_package_helper($input);
Centralize package configuration and bootstrap. If the package exposes config, publish or review it once and keep environment-specific values in .env. Avoid scattering helper behavior assumptions across the codebase; document the v2 helper names and expected inputs in your team’s internal notes or upgrade PR.
Update CI in the same PR. Because v2 adds PHP 8 support and changes coding standards to PSR-12, update the CI matrix deliberately. Test on the PHP versions you actually deploy. If you use PHPCS, align your ruleset with PSR-12 or explicitly pin your own standard so the package change does not unexpectedly reformat unrelated code.
# Example CI matrix
php: [8.0, 8.1, 8.2]
Use the upgrade guide as an executable checklist. Turn each helper rename into a test or static-analysis assertion where practical. For example, add a small test that exercises the package’s primary helper path, and use PHPStan/Psalm or IDE inspections to catch unresolved old helper names. This is more reliable than relying on runtime errors in rarely used Blade partials or queue jobs.
Keep package style tooling separate from application style tooling. The PHPCS checker/fixer norm moving to PSR-12 is a package development change, but it may affect projects that reuse the package’s ruleset or Composer scripts. If you consume its PHPCS config, update your local phpcs.xml after reviewing diffs. Do not let a formatter run across the whole repository in the same commit as helper renames; separate mechanical formatting from behavioral migration.
resources/views and any cached/compiled view directories after clearing view cache:
php artisan view:clear
composer dump-autoload
If a helper “does not exist,” confirm the package version installed and whether the old helper was removed versus merely moved.composer show vendor/package to confirm v2 is installed, then trace the helper to its source with your IDE. If the helper is resolved through Laravel’s container or a service provider, verify the provider is still registered after the major upgrade.function_exists() where appropriate.^2.0 only after migration. If you need a staged rollout, keep v1 on legacy branches and avoid allowing composer update to jump majors unexpectedly in unrelated work.How can I help you explore Laravel packages today?