0

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.

devonzimmi
  • 41
  • 9
  • Which version of Laravel are you using? Form:: is not part of Laravel since Laravel 4.2. You may be using the [Laravel Collective package](https://laravelcollective.com/docs/6.0/html) – Christophe Hubert Aug 01 '20 at 01:05
  • The question you note will work perfectly. Just treat the `Form::` elements exactly as he does with the normal `
    ` elements, add the divs and the spans around them in the same way. Laravel collective forms is just a nice way to save a huge amount of time. Under the hood it is just normal html forms.
    – Watercayman Aug 01 '20 at 01:30

1 Answers1

1

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>
mmabdelgawad
  • 2,385
  • 2
  • 7
  • 15