'How can I write this code less and better in Laravel?
How can I write this code less and better in Laravel? I am writing this code to remove the / r character in the input text and also to calculate the number of characters in the text.
$removeRchar = Str::remove("\r", $request['message']);
$length = Str::length($removeRchar);
if ($length <= 70) {
$pages = 1;
} else {
$pages = ceil($length / 70);
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
