laranail/barua is not on Packagist, so there is no registry-version badge to show; Install covers the VCS route.
Responsive, un-styled Blade email components and a fluent mail builder for Laravel.
Targets PHP ^8.4.1 || ^8.5 on Laravel ^13.0. Built on laranail/package-tools.
Add the VCS repositories (the laranail family does not resolve through Packagist), then require the package:
"repositories": [
{ "type": "vcs", "url": "https://github.com/laranail/barua" },
{ "type": "vcs", "url": "https://github.com/laranail/package-tools" }
]composer require laranail/barua<x-laranail-barua::text>Hello from barua.</x-laranail-barua::text>-
Nothing to register: the service provider is discovered automatically.
-
barua sends through your application's own mail configuration, so set the mailer and
MAIL_FROM_ADDRESS/MAIL_FROM_NAMEin.envas you would for any Laravel mail. -
Optionally, publish the config to change a default:
php artisan vendor:publish --tag=laranail::barua-config
{{-- resources/views/emails/receipt.blade.php --}}
<x-laranail-barua::html lang="en">
<x-laranail-barua::body style="background-color: #f6f9fc;">
<x-laranail-barua::container style="background-color: #ffffff; padding: 32px;">
<x-laranail-barua::heading as="h1" mb="16">Thanks, {{ $name }}</x-laranail-barua::heading>
<x-laranail-barua::text>Your order {{ $orderId }} is on its way.</x-laranail-barua::text>
<x-laranail-barua::link href="{{ $trackingUrl }}">Track it</x-laranail-barua::link>
</x-laranail-barua::container>
</x-laranail-barua::body>
</x-laranail-barua::html>Send one of the bundled messages with the builders and MailSender:
use Simtabi\Laranail\Barua\Builders\DataBuilder;
use Simtabi\Laranail\Barua\Builders\ErrorBuilder;
use Simtabi\Laranail\Barua\Builders\MailBuilder;
use Simtabi\Laranail\Barua\Mail\Messages\Onboarding\WelcomeUser;
use Simtabi\Laranail\Barua\Services\MailSender;
$errors = new ErrorBuilder();
$data = (new DataBuilder())->setData(['name' => $user->name, 'companyName' => 'Acme', 'verification_link' => $verificationUrl]);
$builder = (new MailBuilder(errorBuilder: $errors))->setTo($user->email, $user->name);
$mail = new WelcomeUser(mailBuilder: $builder, dataBuilder: $data, errorBuilder: $errors);
(new MailSender(mailable: $mail, mailBuilder: $builder, dataBuilder: $data, errorBuilder: $errors))
->sendEmail(queued: true);The full walkthrough is in Getting started; everything else is in the documentation index.
Full documentation is at opensource.simtabi.com/documentation/laranail/barua.
- Installation: requirements, VCS setup, publish tags
- Getting started: write an email with the components and send it
- Configuration: every key under
laranail.barua - Architecture: the components, builders, sender and events, and why
- Upgrading: what changed with the family conventions
- Release: how versions are cut and consumed
- Send a bundled template · Build a custom email · Add an attachment
- Queue an email · Preview templates locally
- Publish and customise the views · Inline your own stylesheet
Issues and PRs are welcome; see CONTRIBUTING.md. Report vulnerabilities privately per SECURITY.md. Participation follows the laranail Code of Conduct.
MIT © Simtabi LLC. See LICENSE.