Download the PHP package syntech/notifier without Composer
On this page you can find all versions of the php package syntech/notifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download syntech/notifier
More information about syntech/notifier
Files in syntech/notifier
Package notifier
Short Description A Laravel package to send email notifications on errors
License MIT
Informations about the package notifier
Laravel Error Notifier
Laravel Error Notifier is a Laravel package that sends email notifications whenever an error occurs in your Laravel application. It helps you monitor and address issues promptly.
Installation
Step 1: Install via Composer
You can install the package via Composer. Run the following command in your Laravel application's root directory:
Step 2: Publish the Configuration File
This command will create a configuration file at config/error-notifier.php.
Step 3: Configure the Email Recipient
Open the newly created configuration file config/error-notifier.php and set the email address where error notifications should be sent:
Ensure you set the ERROR_NOTIFIER_EMAIL environment variable in your .env file:
Step 4: Configure Mail Settings
Ensure your Laravel application's mail settings are correctly configured in the .env file. Here's an example configuration using SMTP:
Replace these settings with your actual mail server details.
Step 5: Update Logging Configuration
Add the custom log channel to your application's config/logging.php file:
Step 6: Update Exception Handler
Open the app/Exceptions/Handler.php file and update the report method to log errors to the email channel:
Usage
Once installed and configured, the package will automatically send an email notification whenever an error occurs in your Laravel application. Customizing the Notification Email
If you need to customize the email notification, you can modify the ErrorOccurred notification class located at src/Notifications/ErrorOccurred.php. This class defines the content and structure of the email sent when an error occurs. Example
Here is an example of what the email notification might look like:
Subject: Error Occurred in Your Application
An error has occurred:
- Message: Example error message
- File: /path/to/file.php
- Line: 123
- Stack Trace:
0 /path/to/file.php(123): exampleFunction()
1 {main}
Please address this issue promptly.
Contributing
If you would like to contribute to this package, please follow these steps:
Fork the repository on GitHub.
Create a new branch for your feature or bugfix.
Make your changes and commit them with a descriptive message.
Push your changes to your forked repository.
Submit a pull request to the main repository.
License
This package is open-source software licensed under the MIT license. Support
If you encounter any issues or have questions, please feel free to open an issue on the GitHub repository.