| Package Data | |
|---|---|
| Maintainer Username: | cretueusebiu |
| Maintainer Contact: | cretu.eusebiu@gmail.com (Cretu Eusebiu) |
| Package Create Date: | 2015-07-20 |
| Package Last Update: | 2015-08-03 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-30 15:04:37 |
| Package Statistics | |
|---|---|
| Total Downloads: | 1,561 |
| Monthly Downloads: | 140 |
| Daily Downloads: | 5 |
| Total Stars: | 3 |
| Total Watchers: | 1 |
| Total Forks: | 2 |
| Total Open Issues: | 1 |
composer require illuminate/config
composer require illuminate/mail
composer require hazzard/mail
composer require guzzlehttp/guzzle (required for Mailgun and Mandrill)
use Hazzard\Mail\Mail;
use Illuminate\Container\Container;
use Illuminate\Config\Repository as Config;
// Create a container and config repository.
$app = new Container;
$app['config'] = new Config;
// Set the mail & services configuration.
$app['config']['mail'] = require 'config/mail.php';
$app['config']['services'] = require 'config/services.php';
$mail = new Mail($container);
// Set the storage path used by the views.
$mail->setViewStoragePath(_DIR__.'/path/to/views');
// Make the instance available globally via static methods (optional).
$mail->setAsGlobal();
// Create a class alias (optional).
$mail->classAlias();
Mail::send('emails.welcome', ['key' => 'value'], function ($message) {
$message->to('foo@example.com', 'John Smith')->subject('Welcome!');
});
The rest is the same as Laravel.
To provide a custom view factory register a view binding to the container.
The view factory must implement Illuminate\Contracts\View\Factory and the view Illuminate\Contracts\View\View (or at least to have a render method).
$container['view'] = new CustomViewFactory();