fivesqrd/fluent-laravel

此包最新版本(v2.0.2)无可用许可证信息。

为包含 Fluent PHP 库而设计的 Laravel 5 服务提供者。

v2.0.2 2020-06-13 18:30 UTC

This package is auto-updated.

Last update: 2024-09-14 03:18:37 UTC


README

Laravel 5.5+ 的 Fluent 包

安装

composer require fivesqrd/fluent-laravel

对于 Laravel 5.5 及更高版本,将自动发现外观和服务提供者,您应该已经可以开始使用了

#Send a test message
php artisan fluent:test me@mydomain.com

在应用中使用它


/* Using the facade to build and send notifications on the fly */

Route::get('/notification/send/{address}', function ($address) {
    $messageId = resolve('Fluent')->message()->create()
        ->title('My Laravel Message')
        ->paragraph('Lorem ipsum dolor sit amet, consectetur adipiscing elit.')
        ->to($address)
        ->subject('Testing from Laravel')
        ->send();

    return "Message has been sent - {$messageId}";
});

您可以通过向 .env 文件中添加以下值进一步自定义您的设置

FLUENT_KEY=mykey
FLUENT_SECRET=mysecret
FLUENT_NAME=default from name 
FLUENT_EMAIL=defaultfromaddress@mydomain.com