I am new to Livewire, and I understand how we can easily pass variables to livewire components in blade files. The below code does just that.
@php
$CAR_MAKE = "carMake";
$main_classes = "text-sm md:text-lg border-2";
$placeholder = "Search";
@endphp
<div class="flex mb-4 md:mb-9">
<livewire:components.select :classes="$main_classes" :name="$CAR_MAKE" :placeholder="$placeholder" />
</div>
But it requires creating variables first within PHP tags, and then I can pass the variables to the "select" livewire component. But it is hardcoded data, and I want to pass the data directly without creating variables. That will help in removing lots of extra PHP tags and will improve code quality. So is there a way to do that? Or if there is anything I can do to improve this?
I am hoping to get something like below(no variables declaration):
<div class="flex mb-4 md:mb-9">
<livewire:components.select :classes="text-sm md:text-lg border-2" :name="carMake" :placeholder="Search" />
</div>