Skip to content

Commit

Permalink
feat: using laravel helper to set limit content message
Browse files Browse the repository at this point in the history
  • Loading branch information
tongthanhphu committed May 22, 2024
1 parent 12cdeea commit 33dd32d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions resources/views/events/github/label/edited.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
/**
* @var object $payload
*/
use Illuminate\Support\Str;
$changes = $payload->changes;
$label = $payload->label;
$description = strlen($label->description) < 100 ? $label->description : substr($label->description, 0, 100).'...';
$description = Str::limit($label->description);
if (isset($changes->description->from)) {
$description_changes = strlen($changes->description->from) < 100 ? $changes->description->from : substr($changes->description->from, 0, 100).'...';
$description_changes = Str::limit($changes->description->from);
}
?>

Expand Down
3 changes: 2 additions & 1 deletion resources/views/events/github/pull_request/labeled.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
/**
* @var object $payload
*/
use Illuminate\Support\Str;
$pull_request = $payload->pull_request;
$description = strlen($payload->label->description) > 100 ? $payload->label->description : substr($payload->label->description, 0, 100).'...';
$description = Str::limit($payload->label->description);
?>

‍👷‍♂️🛠️ {!! __('tg-notifier::events/github/pull_request.labeled.title', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
/**
* @var object $payload
*/
use Illuminate\Support\Str;
$pull_request = $payload->pull_request;
$description = strlen($payload->label->description) > 100 ? $payload->label->description : substr($payload->label->description, 0, 100).'...';
$description = Str::limit($payload->label->description);
?>

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

0 comments on commit 33dd32d

Please sign in to comment.