binary-cats/shoutout

An inspirational title for your toasts

Fund package maintenance!
Binary Cats

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/binary-cats/shoutout

1.0.0 2026-01-24 18:22 UTC

This package is auto-updated.

Last update: 2026-01-24 19:42:56 UTC


README

Shoutout

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Inspirational titles for your toasts.

Ever got stuck writing another title for your success toast? Ever got bored with "Success!" message? Shoutout solves this for you with random configurable messages

Installation

composer require binary-cats/shoutout

You can publish the config file with:

php artisan vendor:publish --tag=shoutout-config

This will create config/shoutout.php where you can customize the titles for each notification type. This is the contents of the published config file:

return [

    /*
    |--------------------------------------------------------------------------
    | Default Message Type
    |--------------------------------------------------------------------------
    |
    | The default message type to use when calling Shoutout::random() without
    | specifying a type. Supported: "info", "success", "warning", "danger", "error"
    |
    */

    'default' => 'info',

    /*
    |--------------------------------------------------------------------------
    | Messages
    |--------------------------------------------------------------------------
    |
    | These titles will be randomly selected for toast notifications based
    | on their type. Feel free to customize these to match your app's tone.
    |
    */

    'messages' => [
        'info' => [
            'Just so you know...',
            'A quick heads-up',
            'No alarms, just info',
            'Keeping you in the loop',
            'For your consideration',
            'Minor detail, major impact',
            'Logged and loaded',
            'Nothing urgent',
            'All part of the plan',
            'Thought you might like to know',
            'Friendly little update',
        ],
        'success' => [
            'Achievement unlocked!',
            'Flawless execution',
            'Great success!',
            'Huzzah!',
            'Like a boss',
            'Nice!',
            'Smooth as butter!',
            'That\'s how it\'s done!',
            'Very nice!',
            'Victory dance initiated',
            'We made it!',
            'Well done!',
        ],
        'warning' => [
            'Watch out',
            'Careful now',
            'Hmm...',
            'Warning',
            'Hold up',
            'Attention',
            'Heads up',
        ],
        'danger' => [
            'Oh well',
            'Not good',
        ],
        'error' => [
            'Oops',
            'Oh no',
            'Yikes',
            'Error',
            'So sad',
            'Uh oh!',
        ],
    ],
];

Usage

Shoutout comes in two flavors. You can use a Shoutout facade or a shoutout() helper method:

use BinaryCats\Shoutout\Facades\Shoutout;

// Get a random title using the default type (configured in config)
$title = Shoutout::random();   // Uses 'info' set by default

// Get random titles by specific type
$successTitle = Shoutout::success();  // "Achievement unlocked!", "Nice!", etc.
$infoTitle = Shoutout::info();        // "Just so you know...", "A quick heads-up", etc.
$warningTitle = Shoutout::warning();  // "Watch out", "Careful now", etc.
$dangerTitle = Shoutout::danger();    // "Oh well", "Not good"
$errorTitle = Shoutout::error();      // "Oops", "Oh no", etc.

Example with Toast Notifications

// In a Controller
public function store(Request $request): RedirectResponse
{
    // ... save logic

    return redirect()
        ->route('posts.index')
        ->with('toast', [
            'type' => 'success',
            'title' => Shoutout::success(),
            'message' => 'Post created successfully!'
        ]);
}

or with Livewire Flux:

    Flux::toast(
        heading: Shoutout::success(),
        text: 'Your changes have been saved.',
        variant: 'success',
    );

.. you get the idea.

Testing

Shoutout provides a test fake:

use BinaryCats\Shoutout\Facades\Shoutout;

public function test_it_shows_success_toast(): void
{
    Shoutout::fake()
        ->expect('success')
        ->andReturn('Test Success');

    $response = $this->post('/posts', ['title' => 'Test']);

    $response->assertSessionHas('toast.title', 'Test Success');
}

You can chain fake expectations:

Shoutout::fake()
    ->expect('success')->andReturn('Yay!')
    ->expect('danger')->andReturn('Oh no!')
    ->expect('error')->andReturn('Failed!');

If no expectation is set for a method, the fake will return a random value from config (same as the real implementation).

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.