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 Bundle Laravel Package

pdfloresjdav/bootstrap-bundle

Bootstrap Bundle for Laravel offers ready-to-use Bootstrap components and helpers for building responsive, styled interfaces in PHP applications. It simplifies front-end scaffolding so you can focus on your app logic.

View on GitHub
Deep Wiki
Context7

Getting Started

This package is not a Laravel package — it's a Symfony2 bundle (MopaBootstrapBundle fork published as pdfloresjdav/bootstrap-bundle). As a Laravel developer, you cannot composer require this into a Laravel app and get working Bootstrap integration; the package depends on Symfony's bundle system, DependencyInjection, Assetic, and Twig. Treat it as a reference implementation to borrow ideas from, not a dependency.

Where to look first if you clone it:

  • Mopa\Bundle\BootstrapBundle\ — the bundle class and DI extension (DependencyInjection/Configuration.php defines the mopa_bootstrap config tree).
  • Resources/config/*.xml|yml — service definitions for Twig extensions, form types, and menus.
  • Resources/views/ — Twig templates, including the form themes (Form/fields.html.twig) and layout scaffolds (navbar, base layout).
  • Compiler passes (e.g. form theme registration) — this is the mechanic that wires the Bootstrap form look-and-feel into Twig at compile time.

First use case (in its native Symfony2 world): register the bundle in AppKernel, import its config, then either extend MopaBootstrapBundle::base.html.twig or use {% form_theme form 'MopaBootstrapBundle:Form:fields.html.twig' %} to get Bootstrap-styled forms.

The Laravel translation of "first use case" is: create a BootstrapServiceProvider that publishes a few Blade components (<x-bs.navbar>, <x-bs.input>, <x-bs.alert>) and a config file — don't try to mirror the bundle's DI machinery.

Implementation Patterns

In Symfony, the patterns the bundle encodes are:

  • Form theme injection — a compiler pass merges its Twig form templates into twig.form.resources so every rendered form gets Bootstrap markup without per-template work. In Laravel the analogue is a Blade component (<x-input>) that already outputs form-control / is-invalid classes based on $errors.
  • Twig extensions for markup helpers — icons, labels, badges, navbars rendered by PHP classes registered as Twig extensions. In Laravel, these become Blade components, @directives, or view macros (View::macro('bsIcon', ...)).
  • Configuration tree — mopa_bootstrap: config with nested keys (navbar, form, icons). In Laravel, mirror this in config/bootstrap.php and read it via config('bootstrap.navbar.fixed_top') inside components.
  • Assetic asset pipeline — the bundle expects Bootstrap assets via Assetic filters. For a modern Laravel app, ignore this entirely and use Vite + bootstrap from npm, or a CDN for prototypes.

Practical porting workflow I'd recommend:

  1. Read the form theme template and the navbar macro — those two files capture ~80% of the value.
  2. Reimplement them as anonymous Blade components with @props defaults.
  3. Keep the config keys conceptually identical (navbar.fixed_top, form.control_class) so Symfony docs still make sense to you.
  4. Skip the DI extension, compiler passes, and Assetic — none of that has a clean Laravel equivalent, and hand-rolling a service provider is a few dozen lines.

Gotchas and Tips

  • Wrong ecosystem. No Laravel service provider, no facade, no config stub for php artisan vendor:publish. Any attempt to install it will pull in Symfony framework packages (symfony/framework-bundle, symfony/assetic-bundle) that conflict with Laravel's own Symfony components at incompatible versions.
  • License is NOASSERTION. That means Composer/GitHub couldn't match it to a known SPDX license. The upstream MopaBootstrapBundle is MIT, but this fork is ambiguous — do not copy template code verbatim into a commercial codebase without confirming the license. Reimplementing the concepts (Bootstrap class names, form-control wrapping, error state) is fine; wholesale copying is risky.
  • Zero stars, zero dependents, unmaintained. The upstream MopaBootstrapBundle supported Symfony 2.x, which went EOL in 2019. Expect PHP 7.x-era syntax, assetic filters, and Twig 1.x constructs. Modern PHP 8.3 / Laravel 10+ will not parse or run it cleanly.
  • Debugging in its native env (if you must): the common breakages are (1) forgetting new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle() in AppKernel, (2) calling assetic:dump when use_assetic=false, (3) form themes silently not applying because another bundle later overwrote twig.form.resources — check the resolved value with php bin/console debug:container twig (Symfony 2.x: debug:container --tag=twig.extension style inspection).
  • Extension points you actually want from it: the form theme layout hierarchy (form_row → form_widget → individual field types) and the navbar block structure. Both are directly portable to Blade components; nothing else in the bundle is worth carrying over.
  • The real modern alternative for a Laravel + Bootstrap stack: bootstrap via npm + laravel-vite-plugin, plus a small set of hand-written Blade components for forms/navbars, or an actively maintained component package. Do not spend time forcing a Symfony2 bundle into a Laravel app.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect