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

Bootstrap Form Laravel Package

bgaze/bootstrap-form

bgaze/bootstrap-form is a Laravel package that generates Bootstrap-ready forms through a fluent PHP API. It handles model binding, validation errors, old input, labels, help text, and layout classes, so you can build accessible, styled forms without writing repetitive HTML markup.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a Laravel Blade form-builder package (facade BF::* plus <x-bf::*> components) whose content sinks — label, help, success, prepend/append, Bootstrap 4 custom-file text — intentionally emit raw HTML so call sites can inject markup. v4.2.0 adds an escape setting that follows the package's existing config → form → field cascade and defaults to false. That is architecturally consistent with how every other option in this package resolves, and it is opt-in: existing rendering is byte-identical unless a team opts in.

Integration feasibility. Low-friction. A composer update is sufficient to consume the release; no code changes are required to stay on prior behavior. The meaningful work is not integration but audit: identifying which sinks receive user input, database values, or translation strings today, because those are unescaped at the sink regardless of this setting. The release notes are explicit that this is not boundary escaping, and that framing should drive the rollout plan rather than the version bump.

Technical risk.

  • False security. The single biggest risk is a team enabling escape => true globally and concluding XSS is handled. The docs state the opposite; the setting only affects sink rendering of values that are already strings. Boundary escaping remains the application's job.
  • Silent visual regressions under global opt-in. Any label/addon that relied on raw markup and is not an Htmlable/Blade slot will render as literal tags once escape => true is set at config level. The Htmlable opt-out preserves component slots, but string-concatenated markup will break.
  • Addon heuristic retirement. Addon escaping used to be decided by the value (escaped for °C, raw when a tag appeared). Any call site that depended on that implicit behavior changes when escape => true is set. This is the intended fix, but it is a behavior change at the call site, not just a new flag.
  • Double-encoding fix. Plain-text addons carrying pre-encoded entities now render once-decoded relative to before. Output changes; snapshot and visual-regression tests will diff.
  • Boolean attribute parsing. escape="false", switch, inline, custom, show-all-errors, show-valid-feedback, disable-errors now read only "true"/"false". Previously escape="false" was truthy and enabled the setting. Anyone who passed escape="false" to disable escaping was silently getting escaping; after upgrade they get the behavior they wrote. That is a fix, but it is a rendering change for those call sites. String-valued settings (help="false") are unaffected.
  • Coverage gaps by design. required_mark, validation messages, and standalone BF::label() are outside the setting. BF::label() has its own per-call argument and will not honor a global escape — a consistency trap worth documenting internally.
  • Bootstrap 4 baseline frozen. No regeneration means Bootstrap 4 output is unchanged, which is good for stability but means the new setting is effectively a Bootstrap 5–era feature in practice.

Key questions.

  1. Which Laravel/PHP versions does v4.2.0 support, and does that match our application matrix? (Not stated in the notes.)
  2. Do we have call sites passing escape="false" or any of the affected boolean attributes as strings, and are they covered by tests?
  3. What is our inventory of sinks receiving user-controlled, DB-derived, or translated content? That determines whether the audit is a half-day or a sprint.
  4. Are we prepared to set escape => true at config level, or do we need per-form rollout? Per-field only would be unmanageable at scale.
  5. Do our Blade component slots pass Htmlable/HtmlString (safe under global escape) or raw strings (will break)?
  6. Does the app use Livewire/Alpine re-rendering around these components, and are there hydration paths where escaping behavior differs?

Integration Approach

Stack fit. Laravel + Blade + Bootstrap 5 (Bootstrap 4 rendering frozen). The config cascade (config → form → field) means the setting can be adopted at whatever granularity the codebase tolerates, including a single form for a pilot.

Migration path. No mandatory migration. Bump the constraint, run the suite, ship. Then treat escaping as a deliberate hardening project rather than part of the upgrade: audit sinks, convert intended markup to Htmlable/Blade slots, then flip the config default.

Compatibility.

  • Default escape => false preserves current rendering, so the upgrade itself is non-breaking.
  • The boolean-attribute fix is the only place prior behavior changes without opt-in, and only for call sites that passed the string "false" to a boolean setting.
  • Addon double-encoding fix changes output for pre-encoded entities; expect snapshot churn.
  • BF::label() no longer throws TypeError on an HtmlString — strictly additive.
  • required_mark, validation messages, and standalone BF::label() are unaffected; document that internally so nobody assumes uniform behavior.

Sequencing.

  1. Upgrade in a branch; run unit and visual-regression tests to surface the boolean-attribute and double-encoding diffs.
  2. Grep for escape=, switch=, inline=, custom=, show-all-errors=, show-valid-feedback=, disable-errors= string literals and clean up any "false" workarounds.
  3. Inventory content sinks; classify each as static, developer-authored markup, or dynamic/user-derived.
  4. Convert developer-authored markup in labels/addons to Htmlable or Blade slots so it survives a global opt-in.
  5. Enable escape => true at config level (or per form as an intermediate step) and re-run visual regression.
  6. Confirm boundary escaping on the dynamic sinks independently of this setting — that work is unchanged by the release and remains the actual security control.

Operational Impact

Maintenance. Low steady-state cost. The setting is configuration, not code, and the cascade matches how the package already resolves options. The ongoing burden is documentation discipline: teams must know that escape governs sink rendering only, and that BF::label() and required_mark sit outside it.

Support. Expect questions of the form "we turned on escape, why is our label showing <b>?" and "we turned on escape, why is XSS still possible?" Both are answered by the docs, but both will be asked. A short internal note covering the escape-vs-boundary distinction, the Htmlable opt-out, and the affected boolean attributes will absorb most of it.

Scaling. Negligible runtime cost — escaping at render is cheap relative to the templating already happening. The scaling concern is organizational: per-field opt-in does not scale past a handful of forms, so the end state should be a config-level default with Htmlable exceptions, not scattered ['escape' => true] arrays.

Failure modes.

  • Global escape => true with string-built markup in labels/addons → visible tag leakage on customer-facing forms.
  • Belief that the setting is a security boundary → unchanged XSS exposure with a false sense of remediation.
  • Pre-encoded entities in addons now rendered differently → text corruption or snapshot test failures.
  • A "false" string passed to a boolean setting flips meaning post-upgrade → unexpected toggling of switch, inline, custom, error/feedback display.
  • Inconsistent assumption that BF::label() honors the global setting → escaping applied in one place and not another in the same view.

Ramp-up. Consumer-side ramp-up is near zero: install, read the two docs sections, no code changes. Engineering-lead ramp-up is roughly half a day to inventory sinks and grep the affected attribute names, plus the time to convert intended markup to Htmlable. A pilot on one form with escape => true is a reasonable way to validate the conversion pattern before flipping the config default.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console