Download the PHP package mortogo321/laravel-notify without Composer

On this page you can find all versions of the php package mortogo321/laravel-notify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-notify

Laravel Notify

Latest Version on Packagist Tests Total Downloads GitHub License PHP Version

A flexible Laravel package for sending notifications and alerts to multiple providers including Slack, Discord, Telegram, LINE Notify, and Email.

Features

Requirements

Installation

Install the package via Composer:

Publish the configuration file:

Configuration

Add your notification provider credentials to your .env file:

Getting Provider Credentials

Slack: Get your webhook URL from https://api.slack.com/apps (Incoming Webhooks)

Discord: Server Settings > Integrations > Webhooks > New Webhook

Telegram: Message @BotFather on Telegram, create a bot, then use the helper methods below to get your chat ID

LINE Notify: Generate a personal access token at https://notify-bot.line.me/my/

Email: Uses Laravel's built-in mail system (configure in config/mail.php)

Usage

Basic Usage

Using the default provider:

Using Specific Provider

Send to Multiple Providers

Provider Management

Channel & Group ID Helpers

Each provider includes helper methods to retrieve channel IDs, group IDs, and other useful information.

Slack Helpers

Discord Helpers

Telegram Helpers

LINE Notify Helpers

Email Helpers

Advanced Options

Slack with Attachments

Slack with Block Kit

Discord with Embeds

Telegram with Custom Options

LINE Notify with Sticker

LINE Notify with Image

Email with CC/BCC

Using in Controllers

Using in Jobs

Custom Providers

You can extend the package with custom providers:

Helper Functions

You can create a helper function in your app/helpers.php:

API Reference

NotifyManager Methods

Method Description
provider(?string $name) Get a specific provider instance
send(string $message, array $options = []) Send using default provider
sendToMultiple(array $providers, string $message, array $options = []) Send to multiple providers
extend(string $name, NotificationProvider $provider) Register a custom provider
getProviders() Get list of registered provider names
hasProvider(string $name) Check if provider is registered
getDefaultProvider() Get the default provider name
setDefaultProvider(string $name) Set the default provider
getConfig(?string $key, mixed $default = null) Get configuration value(s)

Provider Methods

All providers implement these methods:

Method Description
send(string $message, array $options = []) Send notification
getName() Get provider name
isEnabled() Check if provider is enabled
getAllConfig() Get all configuration values

Provider-Specific Helpers

Slack

Method Description
getChannel() Get configured channel
getUsername() Get configured username
getIconEmoji() Get configured icon emoji
getWebhookUrl() Get masked webhook URL
listChannels(string $botToken, array $options = []) List available channels
getChannelInfo(string $botToken, string $channelId) Get channel info

Discord

Method Description
getUsername() Get configured username
getAvatarUrl() Get configured avatar URL
getWebhookUrl() Get masked webhook URL
getWebhookId() Extract webhook ID from URL
getWebhookInfo() Get webhook details from Discord
getChannelId() Get channel ID from webhook
getGuildId() Get guild (server) ID from webhook
listGuildChannels(string $botToken, string $guildId) List guild channels

Telegram

Method Description
getChatId() Get configured chat ID
getBotToken() Get masked bot token
getParseMode() Get configured parse mode
getMe() Get bot information
getChat(?string $chatId) Get chat information
getUpdates(array $options = []) Get updates with chat IDs
getChatAdministrators(?string $chatId) Get chat administrators
getChatMemberCount(?string $chatId) Get chat member count
setWebhook(string $url, array $options = []) Set webhook URL
deleteWebhook() Delete webhook
getWebhookInfo() Get webhook info

LINE Notify

Method Description
getAccessToken() Get masked access token
getStatus() Get LINE Notify API status

Email

Method Description
getTo() Get configured recipient(s)
getFrom() Get configured sender
getFromName() Get configured sender name
getSubject() Get configured subject
getCc() Get configured CC recipients
getBcc() Get configured BCC recipients
validateEmail(string $email) Validate an email address
validateEmails(array $emails) Validate multiple emails

Upgrading

From v1.x to v2.0

Testing

Run the test suite:

Run code quality checks:

Roadmap

The following features are planned for future releases:

Troubleshooting

Notification not sending

Provider not found error

Getting Telegram Chat ID

  1. Create a bot via @BotFather
  2. Add the bot to your group/channel
  3. Send a message to the group
  4. Use the helper: Notify::provider('telegram')->getUpdates()
  5. Find your chat ID in the chats array

Getting LINE Notify Token

  1. Go to https://notify-bot.line.me/my/
  2. Click "Generate token"
  3. Select a chat room to receive notifications
  4. Copy the generated token to your .env file

Security

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

MIT License. Please see License File for more information.

Credits

Support

For issues, questions, or contributions, please visit the GitHub repository.


All versions of laravel-notify with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/http Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mortogo321/laravel-notify contains the following files

Loading the files please wait ...