No description
  • PHP 99.4%
  • JavaScript 0.6%
Find a file
2026-03-17 20:50:59 +10:00
.github/workflows feat: support Laravel 13 2026-03-17 20:49:47 +10:00
src ci: add Github Actions 2026-02-16 22:21:38 +10:00
tests fix: fix incorrect URL 2026-02-16 19:50:46 +10:00
.editorconfig feat: initial 2026-02-16 17:53:29 +10:00
.gitignore build: replace bun with npm 2026-02-16 19:38:09 +10:00
.php-cs-fixer.php feat: initial 2026-02-16 17:53:29 +10:00
commitlint.config.js feat: initial 2026-02-16 17:53:29 +10:00
composer.json chore: bump to v0.2.0 2026-03-17 20:50:59 +10:00
CONTRIBUTING.md docs: update readme and add contributing guide 2026-02-16 19:38:18 +10:00
herd.yml feat: initial 2026-02-16 17:53:29 +10:00
lefthook.yml feat: initial 2026-02-16 17:53:29 +10:00
LICENSE feat: initial 2026-02-16 17:53:29 +10:00
mise.toml feat: initial 2026-02-16 17:53:29 +10:00
package.json feat: initial 2026-02-16 17:53:29 +10:00
phpstan.neon feat: initial 2026-02-16 17:53:29 +10:00
phpunit.xml feat: initial 2026-02-16 17:53:29 +10:00
README.md docs: update readme and add contributing guide 2026-02-16 19:38:18 +10:00
rector.php feat: initial 2026-02-16 17:53:29 +10:00

Laravel Notification Channel for Daily Bin

A notification channel for Daily Bin by Chris Arter.

Prerequisites

  • An account on Daily Bin
  • A token with at least the following scopes:
    • ingest:write

Installation

Install using Composer:

composer require rvxlab/laravel-notification-channel-dailybin

Add this to your config/services.php:

'dailybin' => [
    'token' => env('DAILYBIN_TOKEN'),
],

Set your DAILYBIN_TOKEN in your .env file:

DAILYBIN_TOKEN=YOUR TOKEN GOES HERE

Setting Up Your Notification

Add 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());

Contributing

Contributions are very welcome. Please read CONTRIBUTING.md for guidelines.

License

This package is licensed under the MIT License.