1

I have a component in the laravel blade and I want set class or inline style to a component without passing any data but my code not working and mt-5 is not set to x.atom.form component. My simple code is:

<x-atom.form class="mt-5" :data="$fields->main_form"></x-atom.form>

ِYou assume my component code is:

<section class="contact-form"></section>
Iman
  • 369
  • 2
  • 12

1 Answers1

1

resources\views\components\atom\form.blade.php

<section {{ $attributes->merge(['class' => 'contact-form']) }}>
   {{-- ... --}}
   {{-- ...  --}}
</section>

some_file.blade.php

<x-atom.form class="mt-5"></x-atom.form>

docs ref ref2

medilies
  • 1,343
  • 4
  • 22