Download the PHP package utyemma/laranotice without Composer
On this page you can find all versions of the php package utyemma/laranotice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laranotice
Laranotice
Introducing LaraNotice, your go-to package for creating dynamic notifications and email messages effortlessly. LaraNotice allows you to craft and send your notifications with ease while taking advantage of Laravel's powerful built-in notification system.
Setup and Installation
Install LaraNotice in your project
If you intend to store your mail messages in your database, then you’ll be required to run migrations. (Note that this is the default setting)
Usage
Sending Notifications using the Mailable Class
Genrate a mailable class
Format your mail message
Sending Notifications using Laravel's Mail Message Format
Your can learn more about Laravel's default mail message formatting from the Laravel Documentation
Alternatively, if your wish to send a mail instead of create a notification, you can do so by replacing the send method with the 'mail' method
Customizing the Templating Engine
By default, this package makes use of mustache as the default templating system to handle basic templating data. You can learn more about using mustache via the php documentation
However, you are free to use any custom template engine supported by PHP for your entire application or for a single mailable class. You can do so by registering custom template resolvers as shown below
Registering a custom template resolver for a specific mailable class
This example sets the default resolver to make use of Laravel's blade templating engine. You can learn more about Laravel Blade here
Configuring for all mailable classes
Here is an example using handlebars templating engine. Learn more about using Handle Bars in your Laravel Application. Handle Bars Docs
-
Create a simple invokeable class that returns a static renderEngine method
- Update the 'resolver' item in your config file
When this class is provided it will be used in resolving the templates. You must ensure your your mail messages are formatted based on the templating engine you are using as your resolver.
Deleting Mailables
LaraNotice provides a convenient command to clean up mailable classes and their associated database records.
Command Options
--all: Delete all mailable classes and their database records--class=: Specify a single mailable class to delete (e.g., ExampleMailable)--preserve=: Optional. Specify what to keep:database: Preserves database records but deletes filesfiles: Preserves files but deletes database records
The command will ask for confirmation before performing any deletions to prevent accidental data loss.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- Utibe-Abasi Emmanuel
- All Contributors
License
The MIT License (MIT). Please see License File for more information.