https://github.com/laravel-notification-channels/workplace
Workplace notification channel for Laravel
https://github.com/laravel-notification-channels/workplace
Last synced: 8 months ago
JSON representation
Workplace notification channel for Laravel
- Host: GitHub
- URL: https://github.com/laravel-notification-channels/workplace
- Owner: laravel-notification-channels
- License: mit
- Created: 2019-12-28T23:44:35.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-18T13:11:05.000Z (over 2 years ago)
- Last Synced: 2025-03-29T03:32:12.407Z (9 months ago)
- Language: PHP
- Homepage: https://laravel-notification-channels.com/
- Size: 23.4 KB
- Stars: 6
- Watchers: 7
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Workplace Notifications Channel for Laravel
[](https://packagist.org/packages/laravel-notification-channels/workplace)
[](LICENSE.md)
[](https://github.com/laravel-notification-channels/workplace/actions/workflows/phpunit.yml)
[](https://scrutinizer-ci.com/g/laravel-notification-channels/workplace)
[](https://packagist.org/packages/laravel-notification-channels/workplace)
This package makes it easy to send notifications using [Workplace](https://work.facebook.com) with Laravel 5.5+ and 6.0
## Contents
- [Installation](#installation)
- [Usage](#usage)
- [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)
## Installation
You can install the package via composer:
``` bash
composer require laravel-notification-channels/workplace
```
## Usage
You can now use the channel in your `via()` method inside the Notification class.
``` php
use NotificationChannels\Workplace\WorkplaceChannel;
use NotificationChannels\Workplace\WorkplaceMessage;
use Illuminate\Notifications\Notification;
class WorkplaceNotification extends Notification
{
public function via($notifiable)
{
return [WorkplaceChannel::class];
}
public function toWorkplace($notifiable)
{
return new WorkplaceMessage('# Laravel Notification Channels are awesome!');
}
}
```
You also need to add the `routeNotificationForWorkplace()` method in your notifiable model:
``` php
class TestNotifiable
{
use \Illuminate\Notifications\Notifiable;
public function routeNotificationForWorkplace()
{
return 'https://graph.facebook.com//feed?access_token=';
}
}
```
### Available Message methods
- `content('')`: (string) Notification message, supports markdown.
- `asMarkdown()`: Treats the message content as being Markdown (default)
- `asPlainText()`: Treats the message content as being plain text
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Testing
``` bash
$ composer test
```
## Security
If you discover any security related issues, please email mail@goncaloqueiros.net instead of using the issue tracker.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Credits
- [Alexandre Lima](https://github.com/infus0815)
- [Gonçalo Queirós](https://github.com/Ghunti)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.