Blade(Laravel) how to remove extra spaces?

Trying to write as simple code, but when using operators from the Blade, it is often the case that there are unexpected gaps:

<input name="trans[{{$lang}}][title]" title="name" value="@if(!empty($category->localizedTitle)){{$category->localizedTitle}}@else Category Name @endif"><br><br>


The gaps appear inside the input, When triggered by the else condition
Looks like this :
a2681b917d224ccf80dfe200a35f61dc.png
How to deal with them? Is there a comprehensive solution?
July 9th 19 at 10:46
2 answers
July 9th 19 at 10:48
Solution
@else Category Name @Endiff 
 ^ ^
error *syntax error, unexpected end of file* if they are removed, or not be? - omer_Larson commented on July 9th 19 at 10:51
No spaces Blade may no tokens to parse a string: @else{{'Category Name'}}@Endiff - aniya commented on July 9th 19 at 10:54
Enjoy, thanks for the help! - omer_Larson commented on July 9th 19 at 10:57
July 9th 19 at 10:50
Solution
Option 1 using js
api.jquery.com/jQuery.trim
Option 2
Wrote
<input type="text" value="@if(true == true){{'Category Name'}}@endif">
Use the second, as in my case more comfortable, thanks for the help! - omer_Larson commented on July 9th 19 at 10:53

Find more questions by tags Laravel