generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow sending notifications via slack.
- Loading branch information
Showing
3 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Binarcode\LaravelDeveloper\Tests\Fixtures; | ||
|
||
use App\Domains\Discounts\Models\DiscountUses; | ||
use App\Domains\Items\Models\Item; | ||
use App\Domains\Orders\Models\Order; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Notifications\Messages\SlackMessage; | ||
use Illuminate\Notifications\Notification; | ||
|
||
class DummyNotification extends Notification implements ShouldQueue | ||
{ | ||
use Queueable; | ||
|
||
|
||
public function via($notifiable) | ||
{ | ||
return ['slack']; | ||
} | ||
|
||
public function toSlack() | ||
{ | ||
return (new SlackMessage()) | ||
->from('test') | ||
->content("test") | ||
->attachment(function ($att) { | ||
$att->title("Title")->content("Content"); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters