I'm looking for a way to get the id of a record and pass it to a textbox, this search is based on an ID from another input, I have this code, but I got lost on how to perform this search.
public function callIdCustomer($dni)
{
$customerid = Customer::findOrFail($dni);
$this->order->id_customer_id = $customerid;
}
What I am looking for is that the function brings me the id where the client, that is, the input wire:model="ruclient" is equal to the ID field record in my table...
the search would be using this input called rutcliente
<input class="mt-1 rounded-md" type="text" name="rutcliente" id="rutcliente" required wire:model.defer="rutcliente">
and I need that when returning a result I load the id in this input
<div class="col-span-3 sm:col-span-3">
<input type="number" wire:model="order.id_customer_id">
</div>
all this will be executed with a button from the blade.php template
<button class="btn btn-indigo mr-2 mt-10"
wire:click.debounce.400ms="createCustomer"
wire:click.debounce.1000.ms="callIdCustomer"
wire:click.prevent
>
Guardar cliente
</button>
I finally solved it this way