generated from spatie/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Slack and Discord notifier classes
- Loading branch information
1 parent
26842cb
commit 3db60c7
Showing
11 changed files
with
200 additions
and
146 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
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
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
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,19 @@ | ||
<?php | ||
|
||
namespace Kiwilan\Notifier\Utils; | ||
|
||
class NotifierHelpers | ||
{ | ||
public static function truncate(?string $string, int $length = 2000): ?string | ||
{ | ||
if (! $string) { | ||
return null; | ||
} | ||
|
||
if (strlen($string) > $length) { | ||
$string = substr($string, 0, $length - 20).'...'; | ||
} | ||
|
||
return $string; | ||
} | ||
} |
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,121 @@ | ||
<?php | ||
|
||
// it('can use', function () { | ||
// $default = [ | ||
// 'text' => 'Content', | ||
// ]; | ||
|
||
// $legacy = [ | ||
// 'username' => 'Ghostbot', | ||
// 'icon_emoji' => ':ghost:', | ||
// 'channel' => '#random', | ||
// 'text' => 'Content', | ||
// ]; | ||
|
||
// $attachments = [ | ||
// 'text' => [ | ||
// 'type' => 'mrkdwn', | ||
// 'text' => '*Content with attachment*', | ||
// ], | ||
// 'attachments' => [ | ||
// [ | ||
// 'title' => 'Laravel', | ||
// 'title_link' => 'https://laravel.com', | ||
// 'text' => 'Attachment Content', | ||
// 'fallback' => 'Attachment Fallback', | ||
// 'fields' => [ | ||
// [ | ||
// 'title' => 'Project', | ||
// 'value' => 'Laravel', | ||
// 'short' => true, | ||
// ], | ||
// ], | ||
// 'mrkdwn_in' => ['text'], | ||
// 'footer' => 'Laravel', | ||
// 'footer_icon' => 'https://laravel.com/fake.png', | ||
// 'author_name' => 'Author', | ||
// 'author_link' => 'https://laravel.com/fake_author', | ||
// 'author_icon' => 'https://laravel.com/fake_author.png', | ||
// 'ts' => 1234567890, | ||
// ], | ||
// ], | ||
// ]; | ||
|
||
// $blocks = [ | ||
// [ | ||
// 'blocks' => [ | ||
// [ | ||
// 'type' => 'section', | ||
// 'text' => [ | ||
// 'type' => 'mrkdwn', | ||
// 'text' => 'Danny Torrence left the following review for your property:', | ||
// ], | ||
// 'fields' => [ | ||
// [ | ||
// 'type' => 'mrkdwn', | ||
// 'text' => '*Markdown!*', | ||
// ], | ||
// [ | ||
// 'type' => 'plain_text', | ||
// 'text' => str_repeat('a', 1997).'...', | ||
// ], | ||
// [ | ||
// 'type' => 'mrkdwn', | ||
// 'text' => 'Location: 123 Main Street, New York, NY 10010', | ||
// ], | ||
// ], | ||
// ], | ||
// [ | ||
// 'type' => 'divider', | ||
// ], | ||
// [ | ||
// 'type' => 'actions', | ||
// 'elements' => [ | ||
// [ | ||
// 'type' => 'button', | ||
// 'text' => [ | ||
// 'type' => 'plain_text', | ||
// 'text' => 'Example Button', | ||
// ], | ||
// 'action_id' => 'button_example-button', | ||
// ], | ||
// [ | ||
// 'type' => 'button', | ||
// 'text' => [ | ||
// 'type' => 'plain_text', | ||
// 'text' => 'Scary Button', | ||
// ], | ||
// 'action_id' => 'button_scary-button', | ||
// 'style' => 'danger', | ||
// ], | ||
// ], | ||
// ], | ||
// [ | ||
// 'type' => 'header', | ||
// 'text' => [ | ||
// 'type' => 'plain_text', | ||
// 'text' => 'Budget Performance', | ||
// ], | ||
// ], | ||
// [ | ||
// 'type' => 'image', | ||
// 'image_url' => 'https://raw.githubusercontent.com/kiwilan/notifier-laravel/main/docs/banner.jpg', | ||
// 'alt_text' => 'notifier banner', | ||
// ], | ||
// [ | ||
// 'type' => 'section', | ||
// 'block_id' => 'section567', | ||
// 'text' => [ | ||
// 'type' => 'mrkdwn', | ||
// 'text' => 'Markdown *can* be so fun!', | ||
// ], | ||
// 'accessory' => [ | ||
// 'type' => 'image', | ||
// 'image_url' => 'https://raw.githubusercontent.com/kiwilan/notifier-laravel/main/docs/banner.jpg', | ||
// 'alt_text' => 'notifier banner', | ||
// ], | ||
// ], | ||
// ], | ||
// ], | ||
// ]; | ||
// }); |
Oops, something went wrong.