How can I remove the string limit when I display it in the blade?
I tried str_limit($details, $limit = -1)
and str_limit($details, $limit = 1000000)
But still limiting the string when displayed.
EDIT
Controller
$announcement = DB::table('announcement')
->where([
'status' => 1,
'delete' => 0,
])
->where('display_date', '<=', date('Y-m-d'))
->leftJoin('users','announcement.user_id','=','users.id')
->leftJoin('user_details','users.user_details_id','=','user_details.id')
->orderBy('display_date', 'DESC')
->orderBy('announcement.created_at', 'DESC')
->get();
$data['announcement'] = $announcement;
return view( $this->viewpath . 'index' )->with( $data );
BLADE
@foreach($announcement as $index => $val)
<div class="a_body">
<h3 class="a_title">{{ $val->announcement_title }}</h3>
<div class="a_details">{{ $val->announcement_details}}</div>
<div class="a_posted">Posted Date: {{$val->display_date}}</div>
<div class="a_created">By:{{ $val->first_name }} {{ $val->last_name }}</div>
</div>
@endforeach
The issue is likely to do with the database rather than Laravel. Laravel does not limit the string unless you use str_limit
, so removing this code is a good start.
If your string is being limited, then check that the database is storing your full string in the first place. If your database code is using VARCHAR
, you may be limiting your strings to the default 255
character length. Changing this to TEXT
would let you store up to ~64k of data.