Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Slack Slash Command Laravel Package

spatie/laravel-slack-slash-command

Build Slack slash commands in Laravel. Define handlers to validate and process incoming Slack requests, reply within 3 seconds or dispatch jobs for longer work, and send structured responses back to Slack. Includes request/response helpers and simple routing of commands.

View on GitHub
Deep Wiki
Context7

title: Responding to multiple commands weight: 3

You may choose to set up multiple slack commands. On the integrations settings on slack.com you should let them all point to the url you configured in app/config/laravel-slack-slash-command.

Image you've created two slack commands /jaime and /johnsnow

namespace App\SlashCommandHandlers;

use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;

class Jaime extends BaseHandler
{

    public function canHandle(Request $request): bool
    {
        return $request->command == 'jaime';
    }

    public function handle(Request $request): Response
    {
        return $this->respondToSlack("A Lannister always pays his debts");
    }
}
namespace App\SlashCommandHandlers;

use Spatie\SlashCommand\Request;
use Spatie\SlashCommand\Response;

class JohnSnow extends BaseHandler
{

    public function canHandle(Request $request): bool
    {
        return $request->command == 'johnsnow';
    }

    public function handle(Request $request): Response
    {
        return $this->respondToSlack("I know nothing");
    }
}

You'll see a response A Lannister always pays his debts after issueing the /jaime command, and I know nothing after issuing the /johnsnow command.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai