Weave 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

Laravel Html Helper Laravel Package

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...

View on GitHub
Deep Wiki
Context7

Getting Started

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:

  1. Create a branch and update the dependency:
    composer require vendor/package:^2.0
    
  2. Run your test suite and static analysis before changing application code. The helper naming changes are the main expected breakage.
  3. Search for all old helper usages:
    grep -R "oldHelperName\|OldHelperClass" app config routes tests resources
    
  4. Replace old helper names/classes with the v2 names from the upgrade guide.
  5. Run the package’s formatter/checker if you rely on its PHPCS setup:
    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.

Implementation Patterns

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.

Gotchas and Tips

  • Helper naming changes are the real breaking change. Scrutinizer removal and PHPCS/PSR-12 changes do not affect runtime behavior, but renamed helpers can fail at runtime in templates, closures, config files, and tests. Search for both function-style and class-style helper references.
  • PHP 8 support does not automatically mean “safe on all PHP 8 versions.” Check the package’s Composer constraints and test on your deployed PHP minor version. PHP 8 deprecations can surface in helper-heavy code paths that were quiet on PHP 7.
  • Do not assume old helper names remain aliased. Major versions often remove compatibility shims. If the package does provide aliases, treat them as temporary migration aids, not long-term API.
  • Blade templates are a common miss. Global helpers are easy to call from views without imports. Search resources/views and any cached/compiled view directories after clearing view cache:
    php artisan view:clear
    
  • Composer autoload issues can look like helper renames. After upgrading, run:
    composer dump-autoload
    
    If a helper “does not exist,” confirm the package version installed and whether the old helper was removed versus merely moved.
  • Separate formatting noise from migration noise. The PSR-12 change can produce large diffs if you use the package’s fixer. Run PHPCS fixer in its own commit or PR so helper renames and behavior changes remain reviewable.
  • Scrutinizer removal is not a runtime concern, but it may matter if your own quality gates referenced the package’s badge or config. Replace that signal with your own CI/static-analysis coverage if needed.
  • Debugging helper behavior: use 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.
  • Watch for global function collisions. Helper packages often define global functions. If your application defines a function with the same new name, Composer autoload order can decide which one wins. Guard application wrappers with function_exists() where appropriate.
  • Pin your major version intentionally. Use ^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.
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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource