How to return to the line when you reach the end of the card?

Viewed 26

I have a card, and inside it, I have a variable which can be very long. I'm doing this {!!substr($myVariable->text, 0, 275)!!}, which show the 275 first caracter of the variable. But the problem is this :

enter image description here

How can I display all the text without this slide bar please ?

2 Answers

With CSS.

.example{
 overflow:hidden;
}

I think you also need to use the Facade in front of the substr method like: Str::substr()

I think the best is you add a <p> tag to the body of your card and specify the width="100%" for the

` tag.

and I agree with

Str::substr($myVariable->text, 0, 275)

https://laravel.com/docs/8.x/helpers#method-str-substr

Str::substr()
The Str::substr method returns the portion of the string specified by the start and length parameters:

use Illuminate\Support\Str;

$converted = Str::substr('The Laravel Framework', 4, 7);

// Laravel

thanks to @Bennett

Related