A notification channel for Daily Bin by Chris Arter.
- An account on Daily Bin
- A token with at least the following scopes:
ingest:write
Install using Composer:
composer require rvxlab/laravel-notification-channel-dailybinAdd this to your config/services.php:
'dailybin' => [
'token' => env('DAILYBIN_TOKEN'),
],Set your DAILYBIN_TOKEN in your .env file:
DAILYBIN_TOKEN=YOUR TOKEN GOES HEREAdd the Daily Bin channel to your notification and set up a toDailyBin method:
class SomeNotification extends Notification
{
public function via($notifiable)
{
return [DailyBinChannel::class]; // or ['dailyBin']
}
public function toDailyBin($notifiable)
{
return (new DailyBinMessage())
->section('content')
->content('# Hello, world!')
->source('My App'); // Optional
}
}Then either make use of anonymous notification or register a notification route:
use Illuminate\Support\Facades\Notification;
Notification::route('dailyBin', 'whatever you like')
->notify(new SomeNotification());
// OR
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
class User extends Model
{
public function routeNotificationForDailyBin(): string
{
return 'whatever you like'; // or false if you don't want to send notifications
}
}
$user = User::firstOrFail();
$user->notify(new SomeNotification());Contributions are very welcome. Please read CONTRIBUTING.md for guidelines.
This package is licensed under the MIT License.