- How do I install beyondcode/laravel-tag-helper in Laravel?
- Install it with composer require beyondcode/laravel-tag-helper; on Laravel 5.5 and newer package auto-discovery registers the service provider, while older versions require manual TagHelperServiceProvider registration. However, the package was last released on 2018-10-08 and is archived, so installation on a current Laravel and PHP stack is unproven. Treat it as a reference implementation or vendored snapshot rather than a live Composer dependency.
- What Laravel versions does laravel-tag-helper support?
- The documented target is Laravel 5.5 and newer, with auto-discovery from that version. The last release was in October 2018, before Laravel 6+, the Laravel 8+ helper-file reorganization, and PHP 8. There is no verified compatibility with modern Laravel or PHP versions, and the archived repository will not receive patches.
- What is the laravel-tag-helper tag() API and how do I build an HTML element?
- The documented API centers on a tag() HTML builder that creates elements programmatically and lets you chain attributes, including conditional attributes and void or self-closing tags. It is intended to replace messy string concatenation in PHP and Blade. The materials are ambiguous because the 1.1.0 release notes mention auth, guest, and if helpers that the overview does not document, so confirm the actual public API in the source before relying on any behavior.
- Does laravel-tag-helper work with PHP 8 and Laravel 10 or 11?
- There is no verified support for PHP 8 or Laravel 10 and 11; the package's last release predates both major shifts. Composer platform requirements from a 2018 helper package may block installation outright, and the archived status means no compatibility patches will arrive. If you need the pattern, reimplement or vendor it internally instead of requiring it on a modern stack.
- Is beyondcode/laravel-tag-helper still maintained or safe for production?
- No, it should not be treated as a maintained production dependency. The repository is archived, the last release was 2018-10-08, it has 238 stars and zero dependents, and there are no security or compatibility fixes. The defensible uses are as an MIT-licensed reference for an ergonomic pattern or as a frozen, attributed snapshot you own internally.
- Does laravel-tag-helper conflict with Laravel's built-in auth() helper?
- A duplicate global auth() function would collide with Laravel's built-in auth() helper at boot, which is a fatal error. The release notes mention auth helpers while the main documentation describes tag() helpers, so the API is contradictory and cannot be trusted from documentation alone. Before any use, inspect src/helpers.php to confirm whether a global auth() is declared and whether symbols are global functions, namespaced functions, Blade directives, or facade methods.
- How do I use the auth, guest, and if helpers from laravel-tag-helper?
- The 1.1.0 release notes claim auth, guest, and if helpers, but the documented overview only describes a tag() HTML builder, so the helpers' existence and behavior are unverified. A helper named if is especially suspect because if is a reserved keyword and cannot be a normal global function, so it may be a directive or facade method. Because these helpers are security-adjacent, do not use them as an authorization gate; use Laravel's @auth, @guest, and @can instead.
- Can laravel-tag-helper handle conditional attributes like disabled, checked, and selected?
- Yes, conditional attributes such as disabled, checked, selected, and dynamic class or data-* values are a core part of the documented chained-attribute API. That said, modern Laravel provides @class, @checked, @selected, and @disabled natively, which covers much of the same use case. Evaluate whether native Blade directives already solve your problem before adding an archived dependency.
- What are alternatives to laravel-tag-helper for generating HTML in Blade?
- Use native Blade components and anonymous components, plus first-party directives such as @class, @checked, @selected, @disabled, @auth, @guest, and @can. HtmlString and Blade components can handle reusable markup fragments and escaped output. Because the package is MIT-licensed, you can also lift the fluent tag pattern into an internal helper rather than depending on the archived repository.
- Does laravel-tag-helper escape output and protect against XSS?
- The package claims clean escaped output, but that is a claim rather than a verified property in the supplied materials, and no test suite is documented. Any dynamic attribute or content interpolation should be escape-reviewed before production use. For security-sensitive rendering, prefer Laravel's native escaping, Blade components, and HtmlString with explicit trust boundaries.