Weave Code
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
Contact Bundle

Contact Bundle Laravel Package

mremi/contact-bundle

Symfony2 bundle that adds a ready-to-use contact form with optional Contact entity, configurable routing and translations. Install via Composer, enable the bundle, configure it, import routes, and optionally update your DB schema.

View on GitHub
Deep Wiki
Context7

MremiContactBundle provides a ready-to-use contact form for Symfony 2.3+ applications, with sensible defaults and optional customization. It integrates cleanly with the Symfony ecosystem, including routing, validation, and translation.

Use it to quickly add a configurable contact workflow while retaining the flexibility to plug in your own Contact model and persistence if needed.

  • Simple Composer installation and bundle registration
  • Built-in contact form with configurable fields and behavior
  • Optional custom Contact class and database schema support
  • Translation-ready default texts (Symfony translator integration)
  • Routing integration for quick setup in existing apps
Frequently asked questions about Contact Bundle
Can I use MremiContactBundle in a **pure Laravel** project without Symfony dependencies?
No, this bundle is Symfony2-specific and requires Symfony components like Validator, Translation, and Twig. For Laravel, consider native alternatives like **spatie/laravel-contact** or **beberlei/fluent-bundle** to avoid dependency bloat. If you must use it, you’d need to bridge Symfony services (e.g., symfony/validator) into Laravel manually.
How do I **install this bundle in Laravel** if my project uses Symfony components?
Run `composer require mremi/contact-bundle`, then register the bundle in `config/app.php` under `config['bundles']` (if using Symfony Flex) or manually in `AppKernel.php`. Ensure Symfony’s `translator`, `validator`, and `twig` components are also installed and configured. For routing, import the bundle’s YAML routes into Laravel’s `routes/web.php`.
Does this bundle support **Laravel’s Eloquent ORM** instead of Doctrine?
No, the bundle assumes Doctrine ORM by default. To use Eloquent, you’ll need to create a custom storage adapter or override the bundle’s `Contact` entity to work with Eloquent models. Alternatively, store submissions in a flat table or use Laravel’s native database layer without the bundle’s ORM features.
How do I **replace Twig templates** with Laravel Blade?
The bundle’s templates are Twig-based, so you’ll need to manually convert them to Blade or use a Twig bridge like `tightenco/ziggy` + `twig/extra-bundle`. Replace the `Resources/views/` templates in the bundle with Blade equivalents, ensuring paths and logic (e.g., `{{ form_start() }}`) are adapted to Blade syntax like `@formStart`.
What **Laravel versions** or Symfony components does this bundle require?
This bundle requires **Symfony 2.3+**, which may conflict with Laravel’s native systems (e.g., Laravel’s Validator vs. Symfony’s). For Laravel 8/9, test compatibility with Symfony 5/6 components like `symfony/validator` and `symfony/translation`. Avoid mixing versions unless you’re using a hybrid Symfony/Laravel stack.
How do I **customize the contact form fields** or validation rules?
Use Symfony’s FormBuilder configuration in `config.yml` or override the bundle’s form type class. For validation, extend the bundle’s `ContactType` or create a custom form request in Laravel. Example: Add `validation: { name: 'required|max:255' }` to the bundle’s config or override the `validate()` method in a Laravel Form Request.
Can I **send emails** from this bundle without Symfony Mailer?
Yes, but you’ll need to replace Symfony’s `Swiftmailer` with Laravel’s `Mail` facade. Override the bundle’s email service or create a custom handler in Laravel’s `app/Providers/AppServiceProvider` to intercept and forward submissions to Laravel’s mail system using `Mail::send()`.
What are the **alternatives** to this bundle for Laravel?
For Laravel, consider **spatie/laravel-contact** (lightweight, Eloquent-friendly), **beberlei/fluent-bundle** (form handling), or **laravel-share/laravel-contact** (simple form + email). If you need Symfony features, **laravel-symfony-bridge** packages (e.g., `spatie/laravel-symfony-mailer`) can integrate Symfony components without full bundle adoption.
How do I **test this bundle** in a Laravel environment?
Mock Symfony dependencies (e.g., `symfony/validator`) using Laravel’s `Mockery` or `PHPUnit`. Test form submission routes with `Http::post()`, validate responses, and assert database entries (if using Eloquent). For Twig templates, use Blade stubs or a testing bridge like `orchestra/testbench` to simulate Symfony components.
Will this bundle work in **production** with Laravel’s caching or queue systems?
The bundle itself doesn’t integrate with Laravel’s caching or queues, but you can wrap its logic in Laravel’s `Cache` or `Queue` facades. For example, defer email sending with `Mail::later()` or cache form submissions in `Cache::remember()`. Ensure Symfony’s components (e.g., `translator`) are also cache-compatible in your hybrid setup.
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.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware