z-song / laravel-admin

Build a full-featured administrative interface in ten minutes
https://laravel-admin.org
MIT License
11.13k stars 2.81k forks source link

Side-by-side inputs. #5748

Closed gomes2191 closed 1 year ago

gomes2191 commented 1 year ago

Laravel Version: 10 PHP Version: 7.4 Laravel-admin: 1.8.19 Description: Is there any way to put the field side by side and with a label above? image Similar to this, but with the above label.

komarove commented 1 year ago

Try to do like this: $form->text('text', __('Text'))->setWidth('12', 'xs-12') Or you can add you own classes: $form->text('text', __('Text'))->setWidth('8 my_class_for_input', '2 my_class_for_label')

gomes2191 commented 1 year ago

Try to do like this: $form->text('text', __('Text'))->setWidth('12', 'xs-12') Or you can add you own classes: $form->text('text', __('Text'))->setWidth('8 my_class_for_input', '2 my_class_for_label')

I will check if it solves the problem.

gomes2191 commented 1 year ago

I solved it as follows.

$form->column(6, function ($setForm) {
            $setForm->text('duration', 'Duração')->setWidth(12, 12)->placeholder('---')->icon('fa fa-clock-o fa-fw')->autofocus();
});

 $form->column(6, function ($setForm) {
            $setForm->text('duration', 'Duração')->setWidth(12, 12)->placeholder('---')->icon('fa fa-clock-o fa-fw')->autofocus();
});

In the css I did this to prevent the label text from going to the right.

.control-label { text-align: unset !important; }

The result was this:

image