joeri-abbo / laravel-slack
There is no license information available for the latest version (dev-master) of this package.
Laravel slack Package
dev-master
2022-06-12 09:55 UTC
Requires
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.28
- orchestra/testbench: ^7.3
- pestphp/pest: ^1.21
- phpunit/phpunit: ^9.5.10
- squizlabs/php_codesniffer: ^3.6.2
- vimeo/psalm: ^4.23
This package is auto-updated.
Last update: 2025-03-12 15:52:25 UTC
README
Laravel Slack
Getting Started
Prerequisites
- Php 8 and up
- Laravel 9
Installation
To get started require the package with composer.
composer require joeri-abbo/laravel-slack
Publish the package for laravel
php artisan vandor:publish --provider="JoeriAbbo\LaravelSlack\LaravelSlackServiceProvider"
Now go to your config folder and edit the slack.php file. Add your channel id and channel name like below
<?php return [ 'bearer_token' => env('SLACK_BEARER_TOKEN'), 'channels' => [ 'my-new-log-channel' => '#ID-of-slack-channel', ] ];
Now add the JoeriAbbo\Slack\SlackPackageServiceProvider:class to your providers array in config/app.php
And add your bearer token to your .env file with SLACK_BEARER_TOKEN
Now you can easily use the slack for logging or notifications. To notify the channel use the following function.
app('slack.log')->sendMessage('This is a test message')
Usage
Releases
version 1.0.0
- Initial release