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

This package is auto-updated.

Last update: 2024-05-12 14:12:48 UTC


README

Laravel Slack

Test Test Test Test

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