devonzimmi
devonzimmi

Reputation: 41

How to add static text inside a Laravel form text input?

I want to add static text within a laravel form text input.

I created a custom slug field and I want the domain to show left aligned on the input. How would I do this?

{{ Form::label('slug', 'URL:') }}
{{ Form::text('slug', null, ['class' => 'form-control']) }}

This question created by TheLuminor is exactly what I want but I cannot figure out how to do that with the Laravel form builder. I have also skimmed the Forms/HTML section of the Laravel docs and failed to find anything relating to my problem.

Upvotes: 0

Views: 1212

Answers (1)

mmabdelgawad
mmabdelgawad

Reputation: 2545

Try this

{{ Form::label('slug', 'URL:') }}

<div class="input-group">
    {{ Form::text('slug', null, ['class' => 'form-control']) }}
    <div class="input-group-append"><span class="input-group-text">@gmail.com</span></div>
</div>

Upvotes: 1

Related Questions