Skip to content

Commit 33dd32d

Browse files
committed
feat: using laravel helper to set limit content message
1 parent 12cdeea commit 33dd32d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

resources/views/events/github/label/edited.blade.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
/**
33
* @var object $payload
44
*/
5+
use Illuminate\Support\Str;
56
67
$changes = $payload->changes;
78
$label = $payload->label;
8-
$description = strlen($label->description) < 100 ? $label->description : substr($label->description, 0, 100).'...';
9+
$description = Str::limit($label->description);
910
if (isset($changes->description->from)) {
10-
$description_changes = strlen($changes->description->from) < 100 ? $changes->description->from : substr($changes->description->from, 0, 100).'...';
11+
$description_changes = Str::limit($changes->description->from);
1112
}
1213
?>
1314

resources/views/events/github/pull_request/labeled.blade.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
/**
33
* @var object $payload
44
*/
5+
use Illuminate\Support\Str;
56
67
$pull_request = $payload->pull_request;
7-
$description = strlen($payload->label->description) > 100 ? $payload->label->description : substr($payload->label->description, 0, 100).'...';
8+
$description = Str::limit($payload->label->description);
89
?>
910

1011
‍👷‍♂️🛠️ {!! __('tg-notifier::events/github/pull_request.labeled.title', [

resources/views/events/github/pull_request/unlabeled.blade.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
/**
33
* @var object $payload
44
*/
5+
use Illuminate\Support\Str;
56
67
$pull_request = $payload->pull_request;
7-
$description = strlen($payload->label->description) > 100 ? $payload->label->description : substr($payload->label->description, 0, 100).'...';
8+
$description = Str::limit($payload->label->description);
89
?>
910

1011
‍👷‍♂️🛠️ {!! __('tg-notifier::events/github/pull_request.unlabeled.title', [

0 commit comments

Comments
 (0)